import type { ReactNode } from "react";
import { Link } from "wouter";
import Container from "@mui/material/Container";
import Alert from "@mui/material/Alert";
import Button from "@mui/material/Button";
import { usePlatform } from "@/lib/platform";
import "@/pages/workspace.css";
export function WorkspaceShell({
title,
permission,
children,
}: {
title: string;
permission?: string;
children: ReactNode;
}) {
const { principal, can, scope } = usePlatform();
return (
{title}
{!principal ? (
Sign in to continue.{" "}
Account sign-in
) : (
<>
{permission && !can(permission) ? (
Your account does not have permission to view this page.
) : (