"use client"; import { AspectRatio, Button, Center, FileButton, Image, Stack, Text, TextInput, } from "@mantine/core"; import { IconCamera, IconUpload } from "@tabler/icons-react"; import { useState } from "react"; import { MODEL_JOB } from "../model/interface"; import { APIs } from "@/app/lib"; import { AccentColor, MainColor, } from "@/app_modules/_global/color/color_pallet"; import { ComponentGlobal_BoxUploadImage, ComponentGlobal_CardStyles, } from "@/app_modules/_global/component"; import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown"; import dynamic from "next/dynamic"; import "react-quill/dist/quill.snow.css"; import { Job_ComponentBoxUploadImage, Job_ComponentButtonUpdate, } from "../component"; const ReactQuill = dynamic( () => { return import("react-quill"); }, { ssr: false } ); export default function Job_Edit({ dataJob }: { dataJob: MODEL_JOB }) { const [value, setValue] = useState(dataJob); const [reload, setReload] = useState(false); const [file, setFile] = useState(null); const [img, setImg] = useState(); // useShallowEffect(() => { // if (window && window.document) setReload(true); // }, []); return ( <> {value.imageId ? ( Foto ) : ( Upload Gambar )}
{ try { const buffer = URL.createObjectURL( new Blob([new Uint8Array(await files.arrayBuffer())]) ); setImg(buffer); setFile(files); } catch (error) { console.log(error); } }} accept="image/png,image/jpeg" > {(props) => ( )}
{ setValue({ ...value, title: val.currentTarget.value, }); }} /> Syarat & Ketentuan {" "} * { setValue({ ...value, content: val, }); }} /> Deskripsi {" "} * { setValue({ ...value, deskripsi: val, }); }} />
); }