Add command item breadcrumbs
This commit is contained in:
parent
cf6325d0ba
commit
33ecf9faa6
1 changed files with 19 additions and 2 deletions
|
@ -1,12 +1,12 @@
|
||||||
/* eslint-disable react/no-unknown-property */
|
/* eslint-disable react/no-unknown-property */
|
||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState, Fragment } from 'react';
|
||||||
import { Group, Kbd, ScrollArea } from '@mantine/core';
|
import { Group, Kbd, ScrollArea } from '@mantine/core';
|
||||||
import { useDisclosure, useDebouncedValue } from '@mantine/hooks';
|
import { useDisclosure, useDebouncedValue } from '@mantine/hooks';
|
||||||
import { generatePath, useNavigate } from 'react-router';
|
import { generatePath, useNavigate } from 'react-router';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { GoToCommands } from './go-to-commands';
|
import { GoToCommands } from './go-to-commands';
|
||||||
import { Command, CommandPalettePages } from '/@/renderer/features/search/components/command';
|
import { Command, CommandPalettePages } from '/@/renderer/features/search/components/command';
|
||||||
import { Modal, Paper, Spinner } from '/@/renderer/components';
|
import { Button, Modal, Paper, Spinner } from '/@/renderer/components';
|
||||||
import { HomeCommands } from './home-commands';
|
import { HomeCommands } from './home-commands';
|
||||||
import { ServerCommands } from '/@/renderer/features/search/components/server-commands';
|
import { ServerCommands } from '/@/renderer/features/search/components/server-commands';
|
||||||
import { useSearch } from '/@/renderer/features/search/queries/search-query';
|
import { useSearch } from '/@/renderer/features/search/queries/search-query';
|
||||||
|
@ -90,6 +90,23 @@ export const CommandPalette = ({ modalProps }: CommandPaletteProps) => {
|
||||||
scrollAreaComponent={ScrollArea.Autosize}
|
scrollAreaComponent={ScrollArea.Autosize}
|
||||||
size="lg"
|
size="lg"
|
||||||
>
|
>
|
||||||
|
<Group
|
||||||
|
mb="1rem"
|
||||||
|
spacing="sm"
|
||||||
|
>
|
||||||
|
{pages.map((page, index) => (
|
||||||
|
<Fragment key={page}>
|
||||||
|
{index > 0 && ' > '}
|
||||||
|
<Button
|
||||||
|
compact
|
||||||
|
disabled
|
||||||
|
variant="default"
|
||||||
|
>
|
||||||
|
{page?.toLocaleUpperCase()}
|
||||||
|
</Button>
|
||||||
|
</Fragment>
|
||||||
|
))}
|
||||||
|
</Group>
|
||||||
<Command
|
<Command
|
||||||
filter={(value, search) => {
|
filter={(value, search) => {
|
||||||
if (value.includes(search)) return 1;
|
if (value.includes(search)) return 1;
|
||||||
|
|
Reference in a new issue