import type { ReactNode } from 'react';
import { cn } from '../../lib/utils';

export function FormItem(props: {
  children: ReactNode;
  className?: string;
  description?: ReactNode;
  label: ReactNode;
}) {
  return (
    <label className={cn('shFormItem', props.className)}>
      <span className="shFormItemLabel">{props.label}</span>
      {props.children}
      {props.description ? <span className="shFormItemDescription">{props.description}</span> : null}
    </label>
  );
}
