diff --git a/ui/src/components/JobList.tsx b/ui/src/components/JobList.tsx index 3e77434..f63f6ad 100644 --- a/ui/src/components/JobList.tsx +++ b/ui/src/components/JobList.tsx @@ -1,7 +1,8 @@ -import { useMemo } from "react"; +import React, { useMemo } from "react"; import { Link } from "@tanstack/react-router"; import { useTime } from "react-time-sync"; import { MagnifyingGlassIcon } from "@heroicons/react/20/solid"; +import { QueueListIcon } from "@heroicons/react/24/solid"; import { Job } from "@services/jobs"; import { JobState } from "@services/types"; @@ -126,25 +127,93 @@ const JobListItem = ({ job }: JobListItemProps) => ( ); -type JobListProps = { +type EmptySetIconProps = {} & React.ComponentProps<"svg">; + +const EmptySetIcon = (props: EmptySetIconProps) => ( + + + + +); + +const EmptyState = () => ( +
+ +

No jobs

+
+); + +type JobRowsProps = { canShowFewer: boolean; canShowMore: boolean; - loading?: boolean; jobs: Job[]; showFewer: () => void; showMore: () => void; - statesAndCounts: StatesAndCounts | undefined; }; -const JobList = ({ +const JobRows = ({ canShowFewer, canShowMore, jobs, - loading, showFewer, showMore, - statesAndCounts, -}: JobListProps) => { +}: JobRowsProps) => { + if (jobs.length === 0) { + return ; + } + return ( +
+ + +
+ ); +}; + +type JobListProps = { + canShowFewer: boolean; + canShowMore: boolean; + loading?: boolean; + jobs: Job[]; + showFewer: () => void; + showMore: () => void; + statesAndCounts: StatesAndCounts | undefined; +}; + +const JobList = (props: JobListProps) => { + const { loading, statesAndCounts } = props; + return (
@@ -170,41 +239,7 @@ const JobList = ({
- {loading ? ( -
Loading...
- ) : ( -
- - -
- )} + {loading ?
Loading...
: } ); };