mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 05:25:53 +08:00
43 lines
1.0 KiB
TypeScript
43 lines
1.0 KiB
TypeScript
import { Modal } from '@/ui/modal';
|
|
|
|
import {
|
|
StyledModalWrapper,
|
|
StyledContent,
|
|
StyledModalHeader,
|
|
StyledModalFooter,
|
|
StyledModalDivider,
|
|
StyledShortcut,
|
|
} from './style';
|
|
import Input from './input';
|
|
import Result from './content';
|
|
import QuickSearchFooter from './footer';
|
|
type TransitionsModalProps = {
|
|
open: boolean;
|
|
onClose: () => void;
|
|
};
|
|
const isMac = () => {
|
|
return /macintosh|mac os x/i.test(navigator.userAgent);
|
|
};
|
|
export const QuickSearch = ({ open, onClose }: TransitionsModalProps) => {
|
|
return (
|
|
<Modal open={open} onClose={onClose}>
|
|
<StyledModalWrapper data-testid="quick-search-modal-content">
|
|
<StyledModalHeader>
|
|
<Input />
|
|
<StyledShortcut>{isMac() ? '⌘+K' : 'Ctrl+K'}</StyledShortcut>
|
|
</StyledModalHeader>
|
|
<StyledModalDivider />
|
|
<StyledContent>
|
|
<Result />
|
|
</StyledContent>
|
|
|
|
<StyledModalFooter>
|
|
<QuickSearchFooter />
|
|
</StyledModalFooter>
|
|
</StyledModalWrapper>
|
|
</Modal>
|
|
);
|
|
};
|
|
|
|
export default QuickSearch;
|