import { CollectionSortMode } from "@/entrypoints/sidepanel/utils/sortCollections"; import { Button, Menu, MenuItemRadio, MenuList, MenuPopover, MenuTrigger, Tooltip } from "@fluentui/react-components"; import * as ic from "@fluentui/react-icons"; export default function SortCollectionsButton({ value, onChange }: SortCollectionsButtonProps): React.ReactElement { const ColorSortIcon = ic.bundleIcon(ic.ArrowSort20Filled, ic.ArrowSort20Regular); return ( onChange?.(e.checkedItems[0] as CollectionSortMode) } > ); } export type SortCollectionsButtonProps = { value?: CollectionSortMode | null; onChange?: (value: CollectionSortMode) => void; }; const sortIcons: Record = { newest: ic.bundleIcon(ic.Sparkle20Filled, ic.Sparkle20Regular), oldest: ic.bundleIcon(ic.History20Filled, ic.History20Regular), ascending: ic.bundleIcon(ic.TextSortAscending20Filled, ic.TextSortAscending20Regular), descending: ic.bundleIcon(ic.TextSortDescending20Filled, ic.TextSortDescending20Regular), custom: ic.bundleIcon(ic.Star20Filled, ic.Star20Regular) };