import React from "react"; import {CloseButton, Dialog, Heading, Portal, Stack,} from "@chakra-ui/react"; import {OpenChangeDetails} from "@chakra-ui/react/dist/types/components/dialog/namespace"; import {useAppStore} from "../appstore"; import {SearchDialogContent} from "./searchDialogContent"; type SearchDialogProps = { open: boolean; onClose: () => void; }; export function SearchDialog({open, onClose}: SearchDialogProps) { const {searchTerm, clearSearchResults} = useAppStore(); return ( { // @ts-expect-error if (!e.open) { onClose(); } }} closeOnInteractOutside={false} closeOnEscape={false} onEscapeKeyDown={() => { if (searchTerm) { clearSearchResults(); } else { onClose(); } }} > {/* @ts-expect-error chakra dialog typing issue */} {/* @ts-expect-error chakra dialog typing issue */} Store items lookup {/* @ts-expect-error chakra dialog typing issue */} ); }