feat: add quick search listItem icon

This commit is contained in:
JimmFly
2022-12-16 10:34:25 +08:00
parent e0eadbf31c
commit 2a7f78dc8f
@@ -1,7 +1,12 @@
import { Command } from 'cmdk'; import { Command } from 'cmdk';
import { StyledListItem, StyledNotFound } from './style'; import { StyledListItem, StyledNotFound } from './style';
import { useModal } from '@/providers/global-modal-provider'; import { useModal } from '@/providers/global-modal-provider';
import { PaperIcon, LogoUnlogIcon } from '@blocksuite/icons'; import {
PaperIcon,
EdgelessIcon,
LogoUnlogIcon,
AllPagesIcon,
} from '@blocksuite/icons';
import { useEditor } from '@/providers/editor-provider'; import { useEditor } from '@/providers/editor-provider';
import { Dispatch, SetStateAction, useEffect, useState } from 'react'; import { Dispatch, SetStateAction, useEffect, useState } from 'react';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
@@ -36,6 +41,7 @@ export const Results = (props: {
setShowCreatePage(resultsPageMeta.length ? false : true); setShowCreatePage(resultsPageMeta.length ? false : true);
//Determine whether to display the + New page //Determine whether to display the + New page
}, [resultsPageMeta, setShowCreatePage]); }, [resultsPageMeta, setShowCreatePage]);
console.log(resultsPageMeta);
return loading ? null : ( return loading ? null : (
<Command.List> <Command.List>
@@ -53,7 +59,11 @@ export const Results = (props: {
value={result.title} value={result.title}
> >
<StyledListItem> <StyledListItem>
<PaperIcon /> {result.mode === 'edgeless' ? (
<EdgelessIcon />
) : (
<PaperIcon />
)}
<span>{result.title}</span> <span>{result.title}</span>
</StyledListItem> </StyledListItem>
</Command.Item> </Command.Item>