"use client"; import React from "react"; import { useLocal } from "@/lib/utils/use-local"; import get from "lodash.get"; import { ListBetter } from "../tablelist/List"; export const ListUI: React.FC = ({ tabHeader, name, modeTab, column, align = "center", onLoad, take = 20, header, disabledPagination, disabledHeader, disabledHeadTable, hiddenNoRow, disabledHoverRow, onInit, onCount, fm, mode, feature, onChange, delete_name, title, tab, onTab, breadcrumb, content, ready = true, }) => { const local = useLocal({ tab: get(tab, "[0].id"), table: { count: 0 as number, } as any, show: true as boolean, count: 0 as number, readyTitle: true, }); if (!ready) { return (
); } return (
{typeof title === "function" ? title({ ui: local, count: local.count }) : title}
{ const result = await onCount(); local.count = result; local.render(); return result; }} onInit={(e: any) => { local.readyTitle = false; local.table = e; local.render(); setTimeout(() => { local.readyTitle = true; local.render(); }, 100); if (typeof onInit === "function") { onInit(e); } }} />
); };