import SlideOver from "../slideOvers/SlideOver"; import { useState } from "react"; import UploadDocument from "./UploadDocument"; import { useTranslation } from "react-i18next"; interface Props { title: string; initialImage?: string; onLoaded: (image: string, file: File) => void; onClose: () => void; } export default function UploadImage({ title = "", initialImage, onLoaded, onClose }: Props) { const { t } = useTranslation(); const [image, setImage] = useState(initialImage); function onChange(base64: string, file: File) { setImage(base64); onLoaded(base64, file); onClose(); } return (
{image && ( // Subframe-style preview hull: rounded-lg, solid border-default, neutral-primary fill.
{t("shared.uploadedImageAlt")}
)}
} > ); }