Sort regardless of case

This commit is contained in:
Nicolas Mowen 2025-04-11 08:02:31 -06:00
parent 78bd178056
commit 7df33d8dcf

View File

@ -462,6 +462,13 @@ export function SubFilterContent({
setSubLabels,
}: SubFilterContentProps) {
const { t } = useTranslation(["components/filter"]);
const sortedSubLabels = useMemo(
() =>
[...allSubLabels].sort((a, b) =>
a.toLowerCase().localeCompare(b.toLowerCase()),
),
[allSubLabels],
);
return (
<div className="overflow-x-hidden">
<DropdownMenuSeparator className="mb-3" />
@ -482,7 +489,7 @@ export function SubFilterContent({
/>
</div>
<div className="mt-2.5 flex flex-col gap-2.5">
{allSubLabels.map((item) => (
{sortedSubLabels.map((item) => (
<FilterSwitch
key={item}
label={item.replaceAll("_", " ")}