This commit is contained in:
rizrmd 2024-08-06 13:17:48 +00:00
parent 80920b5d8a
commit 2e392e518f
2 changed files with 19 additions and 14 deletions

View File

@ -65,6 +65,7 @@ export const FilterContent: FC<{
} }
.field.search { .field.search {
width: auto;
&.focused, &.focused,
&.filled { &.filled {
input { input {

View File

@ -2,8 +2,9 @@ import { GFCol, parseGenField } from "@/gen/utils";
import { cn } from "@/utils"; import { cn } from "@/utils";
import { fields_map } from "@/utils/format-value"; import { fields_map } from "@/utils/format-value";
import { useLocal } from "@/utils/use-local"; import { useLocal } from "@/utils/use-local";
import { set } from "lib/utils/set";
import get from "lodash.get"; import get from "lodash.get";
import { AlertTriangle, Loader2 } from "lucide-react"; import { AlertTriangle, Loader2, Sticker } from "lucide-react";
import { import {
ChangeEvent, ChangeEvent,
FC, FC,
@ -26,10 +27,9 @@ import { Toaster, toast } from "sonner";
import { call_prasi_events } from "../../.."; import { call_prasi_events } from "../../..";
import { filterWhere } from "../filter/parser/filter-where"; import { filterWhere } from "../filter/parser/filter-where";
import { getFilter } from "../filter/utils/get-filter"; import { getFilter } from "../filter/utils/get-filter";
import { MDLocal } from "../md/utils/typings";
import { Skeleton } from "../ui/skeleton"; import { Skeleton } from "../ui/skeleton";
import { sortTree } from "./utils/sort-tree"; import { sortTree } from "./utils/sort-tree";
import { set } from "lib/utils/set";
import { MDLocal } from "../md/utils/typings";
type OnRowClick = (arg: { type OnRowClick = (arg: {
row: any; row: any;
@ -283,6 +283,7 @@ export const TableList: FC<TableListProp> = ({
try { try {
callback(await result); callback(await result);
} catch (e) { } catch (e) {
console.error(e);
local.status = "error"; local.status = "error";
toast.dismiss(); toast.dismiss();
toast.error( toast.error(
@ -793,12 +794,12 @@ export const TableList: FC<TableListProp> = ({
/> />
) : ( ) : (
<> <>
{Array.isArray(data) && data.length > 0 ? (
<div <div
className="w-full h-full overflow-y-auto c-flex-col" className="w-full h-full overflow-y-auto c-flex-col"
onScroll={local.paging.scroll} onScroll={local.paging.scroll}
> >
{Array.isArray(data) ? ( {data.map((e, idx) => {
data.map((e, idx) => {
return ( return (
<div <div
className="c-flex-grow c-flex" className="c-flex-grow c-flex"
@ -818,11 +819,14 @@ export const TableList: FC<TableListProp> = ({
</PassProp> </PassProp>
</div> </div>
); );
}) })}
) : (
<>No&nbsp;Data asf as</>
)}
</div> </div>
) : (
<div className="c-flex c-items-center c-justify-center c-flex-1 w-full h-full c-flex-col ">
<Sticker size={35} strokeWidth={1.3} />
<div className="c-pt-2">No&nbsp;Data</div>
</div>
)}
</> </>
)} )}
</div> </div>