mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-03 18:40:00 +08:00
feat: update search result
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
import React from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import NoResult from './NotFound';
|
||||
import { Command } from 'cmdk';
|
||||
import { useEditor } from '@/providers/editor-provider';
|
||||
|
||||
const SearchResult = (props: { query: string }) => {
|
||||
const { pageList, search, getPageMeta, openPage } = useEditor();
|
||||
const [results, setResults] = useState({});
|
||||
const query = props.query;
|
||||
useEffect(() => {
|
||||
setResults(search(query));
|
||||
}, [query]);
|
||||
|
||||
const SearchResult = () => {
|
||||
return (
|
||||
<>
|
||||
<NoResult />
|
||||
<Command.Group heading="Letters">
|
||||
<Command.Item>a</Command.Item>
|
||||
<Command.Item>b</Command.Item>
|
||||
<Command.Item>c</Command.Item>
|
||||
</Command.Group>
|
||||
|
||||
<Command.Item>Apple</Command.Item>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user