- document folder - full-text search - blob storage - basic edgeless support Co-authored-by: tzhangchi <terry.zhangchi@outlook.com> Co-authored-by: QiShaoXuan <qishaoxuan777@gmail.com> Co-authored-by: DiamondThree <diamond.shx@gmail.com> Co-authored-by: MingLiang Wang <mingliangwang0o0@gmail.com> Co-authored-by: JimmFly <yangjinfei001@gmail.com> Co-authored-by: Yifeng Wang <doodlewind@toeverything.info> Co-authored-by: Himself65 <himself65@outlook.com> Co-authored-by: lawvs <18554747+lawvs@users.noreply.github.com> Co-authored-by: Qi <474021214@qq.com>
36 lines
977 B
TypeScript
36 lines
977 B
TypeScript
import React from 'react';
|
|
import { AddIcon } from '@blocksuite/icons';
|
|
import { StyledModalFooterContent } from './style';
|
|
import { useModal } from '@/providers/global-modal-provider';
|
|
import { Command } from 'cmdk';
|
|
import { usePageHelper } from '@/hooks/use-page-helper';
|
|
|
|
export const Footer = (props: { query: string }) => {
|
|
const { triggerQuickSearchModal } = useModal();
|
|
const { openPage, createPage } = usePageHelper();
|
|
const query = props.query;
|
|
|
|
return (
|
|
<Command.Item
|
|
data-testid="quickSearch-addNewPage"
|
|
onSelect={async () => {
|
|
const pageId = await createPage({ title: query });
|
|
if (pageId) {
|
|
openPage(pageId);
|
|
}
|
|
|
|
triggerQuickSearchModal();
|
|
}}
|
|
>
|
|
<StyledModalFooterContent>
|
|
<AddIcon />
|
|
{query ? (
|
|
<span>New "{query}" page</span>
|
|
) : (
|
|
<span>New page</span>
|
|
)}
|
|
</StyledModalFooterContent>
|
|
</Command.Item>
|
|
);
|
|
};
|