import { type ReactNode, type SelectHTMLAttributes, forwardRef } from "react"; import cn from "../../utils/classnames.ts"; import { FormError } from "../index.ts"; import LabelTooltip from "./LabelTooltip.tsx"; interface Option { value: string; label: string; disabled?: boolean; } interface OptGroup { label: string; options: Option[]; } type SelectOptions = Option[] | OptGroup[]; interface InputSelectProps extends Omit, "className"> { label: string; placeholder?: string; error?: string; required?: boolean; className?: string; id?: string; options: SelectOptions; tooltip?: string | ReactNode; more?: ReactNode; moreTitle?: string; } const InputSelect = forwardRef( ( { label, placeholder, error, required, className = "", id, options, tooltip = "", more = null, moreTitle = null, ...props }, ref ) => { return (
{error && {error}}
); } ); InputSelect.displayName = "InputSelect"; export default InputSelect;