mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
Improve Jellyfin/Navidrome Album/Song filter, Navidrome artist recent release
- Use `compilation=false` for Navidrome recent releases with artist credit - Add `YesNoSelect` (yes, no, undefined) for `favorite` for Navidrome/Jellyfin `album`/`track`, and Navidrome `compilation` - Fix folderButton translation
This commit is contained in:
parent
b5bdea1845
commit
5456c2c2b8
10 changed files with 119 additions and 62 deletions
33
src/shared/components/yes-no-select/yes-no-select.tsx
Normal file
33
src/shared/components/yes-no-select/yes-no-select.tsx
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { Select, SelectProps } from '/@/shared/components/select/select';
|
||||
|
||||
export interface YesNoSelectProps extends Omit<SelectProps, 'data' | 'onChange' | 'value'> {
|
||||
onChange: (e?: boolean) => void;
|
||||
value?: boolean;
|
||||
}
|
||||
|
||||
export const YesNoSelect = ({ onChange, value, ...props }: YesNoSelectProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<Select
|
||||
clearable
|
||||
data={[
|
||||
{
|
||||
label: t('common.no', { postProcess: 'sentenceCase' }),
|
||||
value: 'false',
|
||||
},
|
||||
{
|
||||
label: t('common.yes', { postProcess: 'sentenceCase' }),
|
||||
value: 'true',
|
||||
},
|
||||
]}
|
||||
onChange={(e) => {
|
||||
onChange(e ? e === 'true' : undefined);
|
||||
}}
|
||||
value={value !== undefined ? value.toString() : undefined}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue