UNPKG

seti-ramesesv1

Version:

Reusable components and context for Next.js apps

58 lines (55 loc) 1.94 kB
import { jsxs, jsx } from 'react/jsx-runtime'; import { loadPage } from 'loader-lib'; import DataList from '../components/common/Datalist.js'; import Spacer from '../components/ui/Spacer.js'; import { useContent } from '../context/ContentContext.js'; import { getUserTasks } from '../stores/task.js'; const cols = [ { name: "refno", title: "Ref No.", }, { name: "type", title: "Type", }, { name: "particulars", title: "Particulars", }, { name: "lastreceiptdate", title: "Receipt Date", }, { name: "totalelapsedtime", title: "Total Elapsed Time", }, ]; const MyTaskTxnList = (props) => { const tag = props.attr.tag; const title = props.attr.title; const target = "main"; const { setContent } = useContent(); const listHandler = async (params) => { const data = await getUserTasks({ ...params, tag }); return data; }; const openItem = async (item) => { const module = item.module; const modpage = `${item.module}`; const page = await loadPage({ page: modpage, module: module, target: target, params: { docno: item.docno }, }); setContent(target, () => page); }; return (jsxs("div", { style: { display: "flex", flexDirection: "column", padding: "1.5rem" }, children: [jsx("p", { style: { fontSize: "1rem", fontWeight: 500 }, children: title }), jsx(Spacer, {}), jsx(DataList, { cols: cols, handler: listHandler, searchMode: "manual", searchFields: ["docno", "type"], openItem: openItem, emptyState: { title: "No Pending Tasks", message: "There are no tasks at the moment. Any future tasks will be shown here.", }, allowSearch: true })] })); }; export { MyTaskTxnList as default }; //# sourceMappingURL=UserTxnListPage.js.map