diff --git a/src/components/RunList/index.tsx b/src/components/RunList/index.tsx index 3ceaa4c..1d09428 100644 --- a/src/components/RunList/index.tsx +++ b/src/components/RunList/index.tsx @@ -12,6 +12,7 @@ import { type MRT_PaginationState, type MRT_Updater, type MRT_ColumnFiltersState, + type MRT_TableOptions, } from 'material-react-table'; import { type Theme } from "@mui/material/styles"; import { parse } from "date-fns"; @@ -172,10 +173,11 @@ type RunListParams = { type RunListProps = { params: DecodedValueMap; setter: SetQuery; + tableOptions?: Partial>; } export default function RunList(props: RunListProps) { - const { params, setter } = props; + const { params, setter, tableOptions } = props; const options = useDefaultTableOptions(); const debouncedParams = useDebounce(params, 500); const columnFilters: MRT_ColumnFiltersState = []; @@ -256,6 +258,7 @@ export default function RunList(props: RunListProps) { if ( category ) return { className: category }; return {}; }, + ...tableOptions, }); if (query.isError) return null; return diff --git a/src/pages/Queue/index.jsx b/src/pages/Queue/index.jsx deleted file mode 100644 index 50c9dbc..0000000 --- a/src/pages/Queue/index.jsx +++ /dev/null @@ -1,19 +0,0 @@ -import Typography from "@mui/material/Typography"; -import { Helmet } from "react-helmet"; - -import RunList from "../../components/RunList"; - -export default function Queue() { - const params = { queued: true }; - return ( -
- - Queue - Pulpito - - - Queue - - -
- ); -} diff --git a/src/pages/Queue/index.tsx b/src/pages/Queue/index.tsx new file mode 100644 index 0000000..4117c84 --- /dev/null +++ b/src/pages/Queue/index.tsx @@ -0,0 +1,29 @@ +import { Helmet } from "react-helmet"; +import { useQueryParams, BooleanParam, withDefault } from "use-query-params"; +import Typography from "@mui/material/Typography"; + +import RunList from "../../components/RunList"; + +export default function Queue() { + const [params, setParams] = useQueryParams({ + queued: withDefault(BooleanParam, true), + }, { + removeDefaultsFromUrl: true, + updateType: "push", + }); + const tableOptions = { + enableFilters: false, + enablePagination: false, + } + return ( +
+ + Queue - Pulpito + + + Queue + + +
+ ); +}