import { useState } from "react"; import { t } from "../i18n"; import { useIsMobile } from "./App"; import { Dialog } from "./Dialog"; import { trash } from "./icons"; import { ToolButton } from "./ToolButton"; import "./ClearCanvas.scss"; const ClearCanvas = ({ onConfirm }: { onConfirm: () => void }) => { const [showDialog, setShowDialog] = useState(false); const toggleDialog = () => { setShowDialog(!showDialog); }; return ( <> {showDialog && ( <>

{t("alerts.clearReset")}

{ onConfirm(); toggleDialog(); }} data-testid="confirm-clear-canvas-button" className="clear-canvas--confirm" />
)} ); }; export default ClearCanvas;