import { FunctionComponent, useMemo } from "react"; import { Text } from "@mantine/core"; import { faPlay } from "@fortawesome/free-solid-svg-icons"; import { ColumnDef, getSortedRowModel } from "@tanstack/react-table"; import { useRunTask } from "@/apis/hooks"; import MutateAction from "@/components/async/MutateAction"; import SimpleTable from "@/components/tables/SimpleTable"; interface Props { tasks: System.Task[]; } const Table: FunctionComponent = ({ tasks }) => { const runTask = useRunTask(); const columns: ColumnDef[] = useMemo[]>( () => [ { header: "Name", accessor: "name", cell: ({ row: { original: { name }, }, }) => { return {name}; }, }, { header: "Interval", accessor: "interval", cell: ({ row: { original: { interval }, }, }) => { return {interval}; }, }, { header: "Next Execution", accessor: "next_run_in", }, { header: "Run", accessor: "job_running", cell: ({ row: { original: { job_id: jobId, job_running: jobRunning }, }, }) => { return ( jobId} > ); }, }, ], [runTask], ); return ( ); }; export default Table;