plane/web/components/custom-attributes/attribute-forms/text-attribute-form.tsx

24 lines
715 B
TypeScript

// react-hook-form
import { Controller } from "react-hook-form";
// ui
import { FormComponentProps, Input } from "components/custom-attributes";
export const TextAttributeForm: React.FC<FormComponentProps> = ({ control }) => (
<div className="space-y-3">
<Controller
control={control}
name="display_name"
render={({ field: { onChange, value } }) => (
<Input placeholder="Enter field title" value={value} onChange={onChange} />
)}
/>
<Controller
control={control}
name="default_value"
render={({ field: { onChange, value } }) => (
<Input placeholder="Enter default value" value={value ?? ""} onChange={onChange} />
)}
/>
</div>
);