import { Modal, Button, Group, Text, Select, Switch } from "@mantine/core"; import { exportPage } from "@/features/page/services/page-service.ts"; import { useState } from "react"; import * as React from "react"; import { ExportFormat } from "@/features/page/types/page.types.ts"; import { notifications } from "@mantine/notifications"; interface PageExportModalProps { pageId: string; open: boolean; onClose: () => void; } export default function PageExportModal({ pageId, open, onClose, }: PageExportModalProps) { const [format, setFormat] = useState(ExportFormat.Markdown); const handleExport = async () => { try { await exportPage({ pageId: pageId, format }); onClose(); } catch (err) { notifications.show({ message: "Export failed:" + err.response?.data.message, color: "red", }); console.error("export error", err); } }; const handleChange = (format: ExportFormat) => { setFormat(format); }; return ( Export page
Format
Include subpages
); } interface ExportFormatSelection { format: ExportFormat; onChange: (value: string) => void; } function ExportFormatSelection({ format, onChange }: ExportFormatSelection) { return (