From 8a911a91159fc4cef23f42f2b25c039775d994a3 Mon Sep 17 00:00:00 2001 From: faisolavolut Date: Wed, 12 Mar 2025 10:41:59 +0700 Subject: [PATCH] fix: add description prop to Field component and pass filter prop in TableUI and TableList components --- components/form/Field.tsx | 8 +++++++- components/tablelist/TableList.tsx | 1 + components/tablelist/TableUI.tsx | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/components/form/Field.tsx b/components/form/Field.tsx index e68858c..854f10e 100644 --- a/components/form/Field.tsx +++ b/components/form/Field.tsx @@ -69,6 +69,7 @@ export interface FieldProps { visibleLabel?: boolean; autoRefresh?: boolean; forceDisabled?: boolean; + description?: string; } export const Field: React.FC = ({ fm, @@ -101,6 +102,7 @@ export const Field: React.FC = ({ search = "api", autoRefresh = false, forceDisabled, + description, }) => { let result = null; const field = useLocal({ @@ -513,7 +515,11 @@ export const Field: React.FC = ({ )} - + {description ? ( +
{description}
+ ) : ( + <> + )} {error ? (
{error}
) : ( diff --git a/components/tablelist/TableList.tsx b/components/tablelist/TableList.tsx index 127beae..4d24f23 100644 --- a/components/tablelist/TableList.tsx +++ b/components/tablelist/TableList.tsx @@ -122,6 +122,7 @@ export const TableList = ({ onChange, filter = true, }: TableListProps) => { + console.log({ filter }); const [show, setShow] = useState(false as boolean); const [data, setData] = useState([]); const sideLeft = diff --git a/components/tablelist/TableUI.tsx b/components/tablelist/TableUI.tsx index 1357970..1ba3df6 100644 --- a/components/tablelist/TableUI.tsx +++ b/components/tablelist/TableUI.tsx @@ -41,6 +41,7 @@ export const TableUI = ({ breadcrumb, title, ready = true, + filter = true, }: TableUIProps) => { const local = useLocal({ tab: get(tab, "[0].id"), @@ -142,6 +143,7 @@ export const TableUI = ({
{local.show ? (