import { useState, type FormEvent } from "react"; import { Link } from "wouter"; import Container from "@mui/material/Container"; import Paper from "@mui/material/Paper"; import TextField from "@mui/material/TextField"; import Button from "@mui/material/Button"; import Alert from "@mui/material/Alert"; import { usePlatform } from "@/lib/platform"; import { ApiNotice } from "@/components/ApiNotice"; import "./workspace.css"; import { WorkspaceNavigation } from "@/components/WorkspaceShell"; export default function WorkspacePage() { const { organization, principal, signIn, signOut, notice } = usePlatform(); const [busy, setBusy] = useState(false); const [error, setError] = useState(null); async function submit(event: FormEvent) { event.preventDefault(); const form = event.currentTarget; const fields = new FormData(form); setBusy(true); setError(null); const email = String(fields.get("email")); const password = String(fields.get("password")); form.reset(); try { await signIn(email, password); } catch (error) { setError(error); } finally { setBusy(false); } } async function logout() { setBusy(true); setError(null); try { await signOut(); } catch (error) { setError(error); } finally { setBusy(false); } } return (

Account Workspace

Sign in with your approved Mani Candles account.

{notice && {notice}} {principal ? ( <>

Your session

Organization: {principal.organizationId}

User: {principal.userId}

Effective permissions

{principal.permissions.length ? (
    {principal.permissions.map((permission) => (
  • {permission}
  • ))}
) : (

No permissions assigned. Contact your administrator.

)}

Open a customer or administration tool below.

) : (
{!organization && ( Set your organization on the{" "} Connection page {" "} before signing in. The first owner must be provisioned on the backend. )} Sessions stay in memory. Reloading or closing this page requires a new sign-in. Forgot password? )}
); }