diff --git a/app/components/ui/field.tsx b/app/components/ui/field.tsx new file mode 100644 index 0000000..e047405 --- /dev/null +++ b/app/components/ui/field.tsx @@ -0,0 +1,32 @@ +import type { ReactNode } from 'react'; +import { InlineMessage } from '~/components/ui/inline-message'; +import { Label } from '~/components/ui/label'; +import { Text } from '~/components/ui/text'; + +interface FieldProps { + label: string; + htmlFor?: string; + required?: boolean; + hint?: string; + error?: string; + // Shown on the right of the label: "Optional" / "Required" + requirement?: 'optional' | 'required'; + action?: ReactNode; + children?: ReactNode; +} + +export function Field({ label, htmlFor, required, hint, error, requirement, action, children }: FieldProps) { + return ( +