Skip to content

Instantly share code, notes, and snippets.

@notflip
Created March 2, 2025 19:30
Show Gist options
  • Select an option

  • Save notflip/83a7a5439a03727c5ec55e4cd347085d to your computer and use it in GitHub Desktop.

Select an option

Save notflip/83a7a5439a03727c5ec55e4cd347085d to your computer and use it in GitHub Desktop.

Revisions

  1. notflip renamed this gist Mar 2, 2025. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. notflip created this gist Mar 2, 2025.
    26 changes: 26 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    import {
    FormControl,
    FormField,
    FormItem,
    FormLabel,
    FormMessage,
    } from "@/components/ui/form"
    import { Input } from "@/components/ui/input"

    export const TextField = ({ name, label, defaultValue, control }: any) => {
    return (
    <FormField
    control={control}
    name={name}
    render={({ field, fieldState: { error } }) => (
    <FormItem>
    <FormLabel>{label}</FormLabel>
    <FormControl>
    <Input placeholder={defaultValue} {...field} />
    </FormControl>
    <FormMessage />
    </FormItem>
    )}
    />
    )
    }