import React, { useState } from "react"; import { ActionsManagerInterface } from "../actions/types"; import { NonDeletedExcalidrawElement } from "../element/types"; import { t } from "../i18n"; import { useIsMobile } from "./App"; import { AppState } from "../types"; import { Dialog } from "./Dialog"; import { exportFile, exportToFileIcon, link } from "./icons"; import { ToolButton } from "./ToolButton"; import { actionSaveAsScene } from "../actions/actionExport"; import { Card } from "./Card"; import "./ExportDialog.scss"; import { supported as fsSupported } from "browser-fs-access"; export type ExportCB = ( elements: readonly NonDeletedExcalidrawElement[], scale?: number, ) => void; const JSONExportModal = ({ elements, appState, actionManager, onExportToBackend, }: { appState: AppState; elements: readonly NonDeletedExcalidrawElement[]; actionManager: ActionsManagerInterface; onExportToBackend?: ExportCB; onCloseRequest: () => void; }) => { return (