import { Box, Button, Checkbox, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, DrawerHeader, DrawerOverlay, FormControl, FormLabel, Image, Input, Select, VStack, } from "@chakra-ui/react"; import { MdEdit } from "react-icons/md"; import { useCardInfoStore } from "./stores/cardInfoStore"; import { useRef } from "react"; import { fileToBase64 } from "./utils"; type Props = { isOpen: boolean; onClose: () => void; }; const EditDrawer = ({ isOpen, onClose }: Props) => { const cardInfo = useCardInfoStore(); const photoInputRef = useRef(null); const onImageChange = async (event: React.ChangeEvent) => { if (!event.target.files?.length) { return; } const file = event.target.files[0]; const data = await fileToBase64(file); cardInfo.setValues({ photo: data }); }; return ( Card Detail Agent Name cardInfo.setValues({ name: e.target.value })} /> ID Number cardInfo.setValues({ idNo: e.target.value })} /> Sex cardInfo.setValues({ sex: e.target.value })} /> Birthday cardInfo.setValues({ birthday: e.target.value }) } /> Access Level cardInfo.setValues({ accessLevel: e.target.value }) } /> Expires in cardInfo.setValues({ showWatermarkOnExport: e.target.checked }) } > Show Watermark on Export ); }; export default EditDrawer;