mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-20 22:14:34 -04:00
4bfaab4b21
(cherry picked from commit b2c43fb2a67965d68d3d35b72302b0cddb5aca23)
90 lines
2.3 KiB
TypeScript
90 lines
2.3 KiB
TypeScript
import React from 'react';
|
|
import MenuContent from 'Components/Menu/MenuContent';
|
|
import SortMenu from 'Components/Menu/SortMenu';
|
|
import SortMenuItem from 'Components/Menu/SortMenuItem';
|
|
import { align } from 'Helpers/Props';
|
|
import SortDirection from 'Helpers/Props/SortDirection';
|
|
import translate from 'Utilities/String/translate';
|
|
|
|
interface IndexerIndexSortMenuProps {
|
|
sortKey?: string;
|
|
sortDirection?: SortDirection;
|
|
isDisabled: boolean;
|
|
onSortSelect(sortKey: string): unknown;
|
|
}
|
|
|
|
function IndexerIndexSortMenu(props: IndexerIndexSortMenuProps) {
|
|
const { sortKey, sortDirection, isDisabled, onSortSelect } = props;
|
|
|
|
return (
|
|
<SortMenu isDisabled={isDisabled} alignMenu={align.RIGHT}>
|
|
<MenuContent>
|
|
<SortMenuItem
|
|
name="status"
|
|
sortKey={sortKey}
|
|
sortDirection={sortDirection}
|
|
onPress={onSortSelect}
|
|
>
|
|
{translate('Status')}
|
|
</SortMenuItem>
|
|
|
|
<SortMenuItem
|
|
name="sortName"
|
|
sortKey={sortKey}
|
|
sortDirection={sortDirection}
|
|
onPress={onSortSelect}
|
|
>
|
|
{translate('Name')}
|
|
</SortMenuItem>
|
|
|
|
<SortMenuItem
|
|
name="added"
|
|
sortKey={sortKey}
|
|
sortDirection={sortDirection}
|
|
onPress={onSortSelect}
|
|
>
|
|
{translate('Added')}
|
|
</SortMenuItem>
|
|
|
|
<SortMenuItem
|
|
name="appProfileId"
|
|
sortKey={sortKey}
|
|
sortDirection={sortDirection}
|
|
onPress={onSortSelect}
|
|
>
|
|
{translate('SyncProfile')}
|
|
</SortMenuItem>
|
|
|
|
<SortMenuItem
|
|
name="priority"
|
|
sortKey={sortKey}
|
|
sortDirection={sortDirection}
|
|
onPress={onSortSelect}
|
|
>
|
|
{translate('Priority')}
|
|
</SortMenuItem>
|
|
|
|
<SortMenuItem
|
|
name="protocol"
|
|
sortKey={sortKey}
|
|
sortDirection={sortDirection}
|
|
onPress={onSortSelect}
|
|
>
|
|
{translate('Protocol')}
|
|
</SortMenuItem>
|
|
|
|
<SortMenuItem
|
|
name="privacy"
|
|
sortKey={sortKey}
|
|
sortDirection={sortDirection}
|
|
onPress={onSortSelect}
|
|
>
|
|
{translate('Privacy')}
|
|
</SortMenuItem>
|
|
</MenuContent>
|
|
</SortMenu>
|
|
);
|
|
}
|
|
|
|
export default IndexerIndexSortMenu;
|