import { BreadcrumbItem, Breadcrumbs, Button, Input } from "@nextui-org/react"; import { useEffect, useState } from "react"; import { api } from "../../lib/utils"; import { LoadingOverlay } from "../../components/LoadingOverlay"; export const ServiceSettingsPage = () => { return (
Home Service Settings

Service Settings

); }; const CanvasSettings = () => { const [loading, setLoading] = useState(true); const [width, setWidth] = useState(""); const [height, setHeight] = useState(""); useEffect(() => { api<{ size: { width: number; height: number } }>("/api/admin/canvas/size") .then(({ status, data }) => { if (status === 200) { if (data.success) { setWidth(data.size.width + ""); setHeight(data.size.height + ""); } else { console.error(status, data); } } else { console.error(status, data); } }) .finally(() => { setLoading(false); }); }, []); const doSaveSize = () => { setLoading(true); api("/api/admin/canvas/size", "POST", { width, height, }) .then(({ status, data }) => { if (status === 200) { if (data.success) { alert("good"); } else { console.error(status, data); } } else { console.error(status, data); } }) .finally(() => { setLoading(false); }); }; return ( <>

Canvas

{loading && }
); };