diff --git a/src/form-builder/components/edit/field-edit.tsx b/src/form-builder/components/edit/field-edit.tsx
index 398ad2f..0e75c9d 100644
--- a/src/form-builder/components/edit/field-edit.tsx
+++ b/src/form-builder/components/edit/field-edit.tsx
@@ -35,8 +35,16 @@ import {
DrawerTitle,
DrawerTrigger,
} from '@/components/ui/drawer'
+import { Field, FieldDescription, FieldLabel } from '@/components/ui/field'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
+import {
+ MultiSelect,
+ MultiSelectContent,
+ MultiSelectItem,
+ MultiSelectTrigger,
+ MultiSelectValue,
+} from '@/components/ui/multi-select'
import { ScrollArea } from '@/components/ui/scroll-area'
import {
Tooltip,
@@ -160,6 +168,72 @@ const socialMediaButtonsVariants = Object.entries(socialLogsUrls).map(
}),
)
+const acceptAttributeOptions = [
+ 'image/*',
+ 'image/png',
+ 'image/jpeg',
+ 'image/gif',
+ '.pdf',
+ 'application/pdf',
+ '.doc',
+ '.docx',
+ '.xls',
+ '.xlsx',
+ 'text/csv',
+ 'audio/*',
+ 'video/*',
+ '.zip',
+].map((value) => ({ value, label: value }))
+
+function getAcceptValues(accept: unknown) {
+ return typeof accept === 'string'
+ ? accept
+ .split(',')
+ .map((value) => value.trim())
+ .filter(Boolean)
+ : []
+}
+
+function AcceptAttributeMultiSelect({
+ value,
+ onChange,
+}: {
+ value: unknown
+ onChange: (values: string[]) => void
+}) {
+ const selectedValues = getAcceptValues(value)
+ const options = [
+ ...acceptAttributeOptions,
+ ...selectedValues
+ .filter(
+ (value) =>
+ !acceptAttributeOptions.some((option) => option.value === value),
+ )
+ .map((value) => ({ value, label: value })),
+ ]
+
+ return (
+
+ Accept attribute
+
+ Select MIME types or file extensions to accept
+
+
+
+
+
+
+ {options.map((option) => (
+
+ {option.label}
+
+ ))}
+
+
+
+ )
+}
+
function OptionsList({
options = [],
onChange,
@@ -679,18 +753,13 @@ function FormElementAttributes({
}}
form={form}
/>
- {
+ form.setValue('accept', selectedValues.join(', '), {
+ shouldDirty: true,
+ })
}}
- form={form}
/>