mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-18 21:54:09 +00:00
22 lines
503 B
TypeScript
22 lines
503 B
TypeScript
import { memo } from 'react';
|
|
import { useDisclosure, useHotkeys } from '@mantine/hooks';
|
|
|
|
import Finder from '../../../views/editor/finder/Finder';
|
|
|
|
export default memo(FinderPlacement);
|
|
|
|
function FinderPlacement() {
|
|
const [isOpen, handler] = useDisclosure();
|
|
|
|
useHotkeys([
|
|
['mod + f', handler.toggle, { preventDefault: true }],
|
|
['Escape', handler.close, { preventDefault: true }],
|
|
]);
|
|
|
|
if (isOpen) {
|
|
return <Finder isOpen={isOpen} onClose={handler.close} />;
|
|
}
|
|
|
|
return null;
|
|
}
|