jan/web/screens/Settings/Advanced/DataFolder/ModalSameDirectory.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

49 lines
1.2 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 showSamePathModalAtom = atom(false)
const ModalSameDirectory = () => {
const [show, setShow] = useAtom(showSamePathModalAtom)
return (
<Modal open={show} onOpenChange={setShow}>
<ModalPortal />
<ModalContent>
<ModalHeader>
<ModalTitle>Unable to move files</ModalTitle>
</ModalHeader>
<p className="text-muted-foreground">
{`It seems like the folder you've chosen same with current directory`}
</p>
<ModalFooter>
<div className="flex gap-x-2">
<ModalClose asChild onClick={() => setShow(false)}>
<Button themes="ghost">Cancel</Button>
</ModalClose>
<ModalClose asChild>
<Button themes="danger" onClick={() => setShow(false)} autoFocus>
Choose a different folder
</Button>
</ModalClose>
</div>
</ModalFooter>
</ModalContent>
</Modal>
)
}
export default ModalSameDirectory