[enhancement/localization]: sort navidrome albums by year, add more language keys

This commit is contained in:
Kendall Garner 2024-02-03 15:05:33 -08:00
parent 86a93866d0
commit 24bf7ae31f
No known key found for this signature in database
GPG key ID: 18D2767419676C87
7 changed files with 56 additions and 22 deletions

View file

@ -1,7 +1,8 @@
import { ChangeEvent, MutableRefObject } from 'react';
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
import { Flex, Group, Stack } from '@mantine/core';
import debounce from 'lodash/debounce';
import { ChangeEvent, MutableRefObject } from 'react';
import { useTranslation } from 'react-i18next';
import { generatePath, Link, useParams, useSearchParams } from 'react-router-dom';
import { useCurrentServer } from '../../../store/auth.store';
import { LibraryItem } from '/@/renderer/api/types';
@ -17,6 +18,7 @@ interface SearchHeaderProps {
}
export const SearchHeader = ({ tableRef, navigationId }: SearchHeaderProps) => {
const { t } = useTranslation();
const { itemType } = useParams() as { itemType: LibraryItem };
const [searchParams, setSearchParams] = useSearchParams();
const cq = useContainerQuery();
@ -70,7 +72,7 @@ export const SearchHeader = ({ tableRef, navigationId }: SearchHeaderProps) => {
}}
variant={itemType === LibraryItem.SONG ? 'filled' : 'subtle'}
>
Tracks
{t('entity.track_other', { postProcess: 'sentenceCase' })}
</Button>
<Button
compact
@ -87,7 +89,7 @@ export const SearchHeader = ({ tableRef, navigationId }: SearchHeaderProps) => {
}}
variant={itemType === LibraryItem.ALBUM ? 'filled' : 'subtle'}
>
Albums
{t('entity.album_other', { postProcess: 'sentenceCase' })}
</Button>
<Button
compact
@ -104,7 +106,7 @@ export const SearchHeader = ({ tableRef, navigationId }: SearchHeaderProps) => {
}}
variant={itemType === LibraryItem.ALBUM_ARTIST ? 'filled' : 'subtle'}
>
Artists
{t('entity.artist_other', { postProcess: 'sentenceCase' })}
</Button>
</Group>
</FilterBar>