diff --git a/frontend/src/components/filter/FilterBar.tsx b/frontend/src/components/filter/FilterBar.tsx index 32a9454..7f6e668 100644 --- a/frontend/src/components/filter/FilterBar.tsx +++ b/frontend/src/components/filter/FilterBar.tsx @@ -1,10 +1,11 @@ -import { Star, X } from 'lucide-react' +import { Star, X, ArrowDown, ArrowUp } from 'lucide-react' import clsx from 'clsx' import { useFilterStore, type MediaType, type ColorLabel, type FlagFilter, + type SortField, } from '../../store/filterStore' const MEDIA_TYPES: { value: MediaType; label: string }[] = [ @@ -28,6 +29,14 @@ const FLAG_OPTIONS: { value: FlagFilter; label: string }[] = [ { value: 'discarded', label: 'Discarded' }, ] +const SORT_OPTIONS: { value: SortField; label: string }[] = [ + { value: 'taken_at', label: 'Date taken' }, + { value: 'added_at', label: 'Date added' }, + { value: 'filename', label: 'Filename' }, + { value: 'file_size', label: 'File size' }, + { value: 'rating', label: 'Rating' }, +] + export function FilterBar() { const filterBarOpen = useFilterStore((s) => s.filterBarOpen) const dateFrom = useFilterStore((s) => s.dateFrom) @@ -36,6 +45,8 @@ export function FilterBar() { const ratingMin = useFilterStore((s) => s.ratingMin) const colorLabel = useFilterStore((s) => s.colorLabel) const flag = useFilterStore((s) => s.flag) + const sortBy = useFilterStore((s) => s.sortBy) + const sortOrder = useFilterStore((s) => s.sortOrder) const setDateFrom = useFilterStore((s) => s.setDateFrom) const setDateTo = useFilterStore((s) => s.setDateTo) @@ -43,6 +54,8 @@ export function FilterBar() { const setRatingMin = useFilterStore((s) => s.setRatingMin) const setColorLabel = useFilterStore((s) => s.setColorLabel) const setFlag = useFilterStore((s) => s.setFlag) + const setSortBy = useFilterStore((s) => s.setSortBy) + const toggleSortOrder = useFilterStore((s) => s.toggleSortOrder) const clearAll = useFilterStore((s) => s.clearAll) if (!filterBarOpen) return null @@ -157,6 +170,32 @@ export function FilterBar() { })} + {/* Sort */} + + + + +