2023-09-12 14:06:35 +00:00
|
|
|
// react-hook-form
|
2023-09-13 16:55:47 +00:00
|
|
|
import { Controller } from "react-hook-form";
|
|
|
|
// components
|
|
|
|
import { FormComponentProps, Input } from "components/custom-attributes";
|
2023-09-12 14:06:35 +00:00
|
|
|
|
2023-09-13 16:55:47 +00:00
|
|
|
export const UrlAttributeForm: 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 type="url" placeholder="Enter default URL" value={value ?? ""} onChange={onChange} />
|
2023-09-12 14:06:35 +00:00
|
|
|
)}
|
2023-09-13 16:55:47 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|