jan/web/screens/Settings/Advanced/DataFolder/ModalErrorSetDestGlobal.tsx
NamH 23dfb1c12f
fix: cannot change jan data folder (#1805)
Signed-off-by: James <james@jan.ai>
Co-authored-by: James <james@jan.ai>
2024-01-26 20:07:18 +07:00

44 lines
1.0 KiB
TypeScript

import React from 'react'
import {
Modal,
ModalPortal,
ModalContent,
ModalHeader,
ModalTitle,
ModalFooter,
ModalClose,
Button,
} from '@janhq/uikit'
import { atom, useAtom } from 'jotai'
export const showChangeFolderErrorAtom = atom(false)
const ModalErrorSetDestGlobal = () => {
const [show, setShow] = useAtom(showChangeFolderErrorAtom)
return (
<Modal open={show} onOpenChange={setShow}>
<ModalPortal />
<ModalContent>
<ModalHeader>
<ModalTitle>Error Occurred</ModalTitle>
</ModalHeader>
<p className="text-muted-foreground">
Oops! Something went wrong. Jan data folder remains the same. Please
try again.
</p>
<ModalFooter>
<div className="flex gap-x-2">
<ModalClose asChild onClick={() => setShow(false)}>
<Button themes="danger">Got it</Button>
</ModalClose>
</div>
</ModalFooter>
</ModalContent>
</Modal>
)
}
export default ModalErrorSetDestGlobal