mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-04 03:31:40 +00:00
Lint all files
This commit is contained in:
parent
22af76b4d6
commit
30e52ebb54
334 changed files with 76519 additions and 75932 deletions
|
|
@ -11,68 +11,70 @@ import { useCurrentServer } from '/@/renderer/store';
|
|||
import { ServerType } from '/@/renderer/types';
|
||||
|
||||
interface HomeCommandsProps {
|
||||
handleClose: () => void;
|
||||
pages: CommandPalettePages[];
|
||||
query: string;
|
||||
setPages: Dispatch<CommandPalettePages[]>;
|
||||
setQuery: Dispatch<string>;
|
||||
handleClose: () => void;
|
||||
pages: CommandPalettePages[];
|
||||
query: string;
|
||||
setPages: Dispatch<CommandPalettePages[]>;
|
||||
setQuery: Dispatch<string>;
|
||||
}
|
||||
|
||||
export const HomeCommands = ({
|
||||
query,
|
||||
setQuery,
|
||||
pages,
|
||||
setPages,
|
||||
handleClose,
|
||||
query,
|
||||
setQuery,
|
||||
pages,
|
||||
setPages,
|
||||
handleClose,
|
||||
}: HomeCommandsProps) => {
|
||||
const navigate = useNavigate();
|
||||
const server = useCurrentServer();
|
||||
const navigate = useNavigate();
|
||||
const server = useCurrentServer();
|
||||
|
||||
const handleCreatePlaylistModal = useCallback(() => {
|
||||
handleClose();
|
||||
const handleCreatePlaylistModal = useCallback(() => {
|
||||
handleClose();
|
||||
|
||||
openModal({
|
||||
children: <CreatePlaylistForm onCancel={() => closeAllModals()} />,
|
||||
size: server?.type === ServerType?.NAVIDROME ? 'xl' : 'sm',
|
||||
title: 'Create Playlist',
|
||||
});
|
||||
}, [handleClose, server?.type]);
|
||||
openModal({
|
||||
children: <CreatePlaylistForm onCancel={() => closeAllModals()} />,
|
||||
size: server?.type === ServerType?.NAVIDROME ? 'xl' : 'sm',
|
||||
title: 'Create Playlist',
|
||||
});
|
||||
}, [handleClose, server?.type]);
|
||||
|
||||
const handleSearch = () => {
|
||||
navigate(
|
||||
{
|
||||
pathname: generatePath(AppRoute.SEARCH, { itemType: LibraryItem.SONG }),
|
||||
search: createSearchParams({
|
||||
query,
|
||||
}).toString(),
|
||||
},
|
||||
{
|
||||
state: {
|
||||
navigationId: nanoid(),
|
||||
},
|
||||
},
|
||||
const handleSearch = () => {
|
||||
navigate(
|
||||
{
|
||||
pathname: generatePath(AppRoute.SEARCH, { itemType: LibraryItem.SONG }),
|
||||
search: createSearchParams({
|
||||
query,
|
||||
}).toString(),
|
||||
},
|
||||
{
|
||||
state: {
|
||||
navigationId: nanoid(),
|
||||
},
|
||||
},
|
||||
);
|
||||
handleClose();
|
||||
setQuery('');
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Command.Group heading="Commands">
|
||||
<Command.Item
|
||||
value="Search"
|
||||
onSelect={handleSearch}
|
||||
>
|
||||
{query ? `Search for "${query}"...` : 'Search...'}
|
||||
</Command.Item>
|
||||
<Command.Item onSelect={handleCreatePlaylistModal}>Create playlist...</Command.Item>
|
||||
<Command.Item onSelect={() => setPages([...pages, CommandPalettePages.GO_TO])}>
|
||||
Go to page...
|
||||
</Command.Item>
|
||||
<Command.Item
|
||||
onSelect={() => setPages([...pages, CommandPalettePages.MANAGE_SERVERS])}
|
||||
>
|
||||
Server commands...
|
||||
</Command.Item>
|
||||
</Command.Group>
|
||||
</>
|
||||
);
|
||||
handleClose();
|
||||
setQuery('');
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Command.Group heading="Commands">
|
||||
<Command.Item
|
||||
value="Search"
|
||||
onSelect={handleSearch}
|
||||
>
|
||||
{query ? `Search for "${query}"...` : 'Search...'}
|
||||
</Command.Item>
|
||||
<Command.Item onSelect={handleCreatePlaylistModal}>Create playlist...</Command.Item>
|
||||
<Command.Item onSelect={() => setPages([...pages, CommandPalettePages.GO_TO])}>
|
||||
Go to page...
|
||||
</Command.Item>
|
||||
<Command.Item onSelect={() => setPages([...pages, CommandPalettePages.MANAGE_SERVERS])}>
|
||||
Server commands...
|
||||
</Command.Item>
|
||||
</Command.Group>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue