diff --git a/components/jobs/jobs-time-filter.tsx b/components/jobs/jobs-time-filter.tsx new file mode 100644 index 0000000..9615003 --- /dev/null +++ b/components/jobs/jobs-time-filter.tsx @@ -0,0 +1,48 @@ +'use client' + +import { useShallow } from 'zustand/react/shallow' +import { useUserSettingsStore } from '@/stores/user-settings/store' +import { cn } from '@/lib/utils' +import { debugProps } from '@/lib/debug' +import { + JOBS_TIME_FILTER_VALUES, + DEFAULT_JOBS_TIME_FILTER, + type JobsTimeFilter, +} from '@/lib/jobs-time-filter' + +const LABELS: Record = { + '1h': '1 uur', + '24h': '24 uur', + all: 'Alles', +} + +export default function JobsTimeFilterControl() { + const current = + useUserSettingsStore( + useShallow((s) => s.entities.settings.views?.jobs?.timeFilter), + ) ?? DEFAULT_JOBS_TIME_FILTER + const setPref = useUserSettingsStore((s) => s.setPref) + + return ( +
+ {JOBS_TIME_FILTER_VALUES.map((v) => ( + + ))} +
+ ) +}