mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-05 13:07:44 +03:00
Sort regardless of case
This commit is contained in:
parent
78bd178056
commit
7df33d8dcf
@ -462,6 +462,13 @@ export function SubFilterContent({
|
|||||||
setSubLabels,
|
setSubLabels,
|
||||||
}: SubFilterContentProps) {
|
}: SubFilterContentProps) {
|
||||||
const { t } = useTranslation(["components/filter"]);
|
const { t } = useTranslation(["components/filter"]);
|
||||||
|
const sortedSubLabels = useMemo(
|
||||||
|
() =>
|
||||||
|
[...allSubLabels].sort((a, b) =>
|
||||||
|
a.toLowerCase().localeCompare(b.toLowerCase()),
|
||||||
|
),
|
||||||
|
[allSubLabels],
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<div className="overflow-x-hidden">
|
<div className="overflow-x-hidden">
|
||||||
<DropdownMenuSeparator className="mb-3" />
|
<DropdownMenuSeparator className="mb-3" />
|
||||||
@ -482,7 +489,7 @@ export function SubFilterContent({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-2.5 flex flex-col gap-2.5">
|
<div className="mt-2.5 flex flex-col gap-2.5">
|
||||||
{allSubLabels.map((item) => (
|
{sortedSubLabels.map((item) => (
|
||||||
<FilterSwitch
|
<FilterSwitch
|
||||||
key={item}
|
key={item}
|
||||||
label={item.replaceAll("_", " ")}
|
label={item.replaceAll("_", " ")}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user