diff --git a/components/form/Field.tsx b/components/form/Field.tsx index 4a3faef..b290d5a 100644 --- a/components/form/Field.tsx +++ b/components/form/Field.tsx @@ -73,6 +73,7 @@ export interface FieldProps { styleField?: string | null; isDebounce?: boolean; data?: any; + mode?: string; } export const Field: React.FC = ({ fm, @@ -108,6 +109,7 @@ export const Field: React.FC = ({ description, styleField, isDebounce = false, + mode, }) => { let result = null; const field = useLocal({ @@ -470,6 +472,7 @@ export const Field: React.FC = ({ disabled={is_disable} className={className} onChange={onChange} + mode={mode} /> ) : ( diff --git a/components/form/field/TypeTag.tsx b/components/form/field/TypeTag.tsx index cb59e4e..904ea6d 100644 --- a/components/form/field/TypeTag.tsx +++ b/components/form/field/TypeTag.tsx @@ -14,6 +14,7 @@ export const TypeTag: React.FC = ({ field, onChange, styleField, + mode, }) => { const [tags, setTags] = useState(fm.data?.[name] || []); const [inputValue, setInputValue] = useState(""); diff --git a/components/list/ListUIClean.tsx b/components/list/ListUIClean.tsx index 74181c6..514ed6d 100644 --- a/components/list/ListUIClean.tsx +++ b/components/list/ListUIClean.tsx @@ -80,7 +80,7 @@ export const ListUIClean: React.FC = ({ content={content} onLoad={onLoad} onCount={async (params: any) => { - const result = await onCount(); + const result = await onCount(params); local.count = result; local.render(); return result; diff --git a/components/partials/SidebarBetter.tsx b/components/partials/SidebarBetter.tsx index ebb7962..3ff4a76 100644 --- a/components/partials/SidebarBetter.tsx +++ b/components/partials/SidebarBetter.tsx @@ -659,7 +659,14 @@ const SidebarBetterTree: React.FC = ({ - {!mini && "Notifications"} + {!mini && ( +
+ Notifications{" "} +
+ 912 +
+
+ )} diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsx index b5a2e8a..203018d 100644 --- a/components/ui/dialog.tsx +++ b/components/ui/dialog.tsx @@ -31,8 +31,10 @@ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName; const DialogContent = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, children, onClick, ...props }, ref) => ( + React.ComponentPropsWithoutRef & { + classClose?: string; + } +>(({ className, children, classClose, onClick, ...props }, ref) => ( Close ) : ( - + Close diff --git a/utils/convertObjectForm.ts b/utils/convertObjectForm.ts new file mode 100644 index 0000000..04129da --- /dev/null +++ b/utils/convertObjectForm.ts @@ -0,0 +1,26 @@ +export const convertFormObject = ({ + data, + form = new FormData(), + task, +}: { + data: any; + form?: FormData; + task: ({ + keys, + value, + form, + }: { + keys: string; + value: any; + form: FormData; + }) => void; +}) => { + function processObject(obj: any, parentKey: string = "") { + for (const [key, value] of Object.entries(obj)) { + task({ keys: key, value, form }); + } + } + + processObject(data); + return form; +};