From 2e392e518fe5e5aa34555f0c74aa02a6e3f96196 Mon Sep 17 00:00:00 2001 From: rizrmd Date: Tue, 6 Aug 2024 13:17:48 +0000 Subject: [PATCH] fix --- comps/filter/FilterContent.tsx | 1 + comps/list/TableList.tsx | 32 ++++++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/comps/filter/FilterContent.tsx b/comps/filter/FilterContent.tsx index 28a2c47..e72f5e3 100755 --- a/comps/filter/FilterContent.tsx +++ b/comps/filter/FilterContent.tsx @@ -65,6 +65,7 @@ export const FilterContent: FC<{ } .field.search { + width: auto; &.focused, &.filled { input { diff --git a/comps/list/TableList.tsx b/comps/list/TableList.tsx index 2b4628e..4b2e302 100755 --- a/comps/list/TableList.tsx +++ b/comps/list/TableList.tsx @@ -2,8 +2,9 @@ import { GFCol, parseGenField } from "@/gen/utils"; import { cn } from "@/utils"; import { fields_map } from "@/utils/format-value"; import { useLocal } from "@/utils/use-local"; +import { set } from "lib/utils/set"; import get from "lodash.get"; -import { AlertTriangle, Loader2 } from "lucide-react"; +import { AlertTriangle, Loader2, Sticker } from "lucide-react"; import { ChangeEvent, FC, @@ -26,10 +27,9 @@ import { Toaster, toast } from "sonner"; import { call_prasi_events } from "../../.."; import { filterWhere } from "../filter/parser/filter-where"; import { getFilter } from "../filter/utils/get-filter"; +import { MDLocal } from "../md/utils/typings"; import { Skeleton } from "../ui/skeleton"; import { sortTree } from "./utils/sort-tree"; -import { set } from "lib/utils/set"; -import { MDLocal } from "../md/utils/typings"; type OnRowClick = (arg: { row: any; @@ -283,6 +283,7 @@ export const TableList: FC = ({ try { callback(await result); } catch (e) { + console.error(e); local.status = "error"; toast.dismiss(); toast.error( @@ -793,12 +794,12 @@ export const TableList: FC = ({ /> ) : ( <> -
- {Array.isArray(data) ? ( - data.map((e, idx) => { + {Array.isArray(data) && data.length > 0 ? ( +
+ {data.map((e, idx) => { return (
= ({
); - }) - ) : ( - <>No Data asf as - )} -
+ })} +
+ ) : ( +
+ +
No Data
+
+ )} )}