FormGroup.tsx 402 B

12345678910111213141516
  1. import './FormGroup.scss'
  2. import type { PropsWithChildren } from 'react'
  3. export interface FormGroupProps {
  4. className?: string
  5. name?: string
  6. }
  7. export default function FormGroup({ className = '', name, ...props }: PropsWithChildren<FormGroupProps>) {
  8. return (
  9. <fieldset className={`fieldset ${className}`}>
  10. {name && <legend>{name}</legend>}
  11. {props.children}
  12. </fieldset>
  13. )
  14. }