From 4141db0e14f70b65f2ee59694ca8a640f861c152 Mon Sep 17 00:00:00 2001 From: faisolavolut Date: Wed, 22 Jan 2025 10:29:26 +0700 Subject: [PATCH] disabled upload --- components/form/Field.tsx | 2 ++ components/form/field/TypeUpload.tsx | 40 +++++++++++++++++----------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/components/form/Field.tsx b/components/form/Field.tsx index f3a4650..3b604c9 100644 --- a/components/form/Field.tsx +++ b/components/form/Field.tsx @@ -139,6 +139,7 @@ export const Field: React.FC = ({ name={name} on_change={onChange} mode={"upload"} + disabled={is_disable} /> ) : ["multi-upload"].includes(type) ? ( @@ -149,6 +150,7 @@ export const Field: React.FC = ({ on_change={onChange} mode={"upload"} type="multi" + disabled={is_disable} /> ) : ["dropdown"].includes(type) ? ( diff --git a/components/form/field/TypeUpload.tsx b/components/form/field/TypeUpload.tsx index ccae773..01254fa 100644 --- a/components/form/field/TypeUpload.tsx +++ b/components/form/field/TypeUpload.tsx @@ -1,27 +1,35 @@ import { FieldUploadMulti } from "./TypeUploadMulti"; import { FieldUploadSingle } from "./TypeUploadSingle"; -export const TypeUpload: React.FC = ({name, fm, on_change, mode, type}) => { - if(type === "multi"){ - - return ( - <> - - - ); +export const TypeUpload: React.FC = ({ + name, + fm, + on_change, + mode, + type, + disabled, +}) => { + if (type === "multi") { + return ( + <> + + + ); } return ( <>