38 lines
1.6 KiB
TypeScript
38 lines
1.6 KiB
TypeScript
"use client";
|
||
|
||
import Link from "next/link";
|
||
import { useMe } from "@/hooks/useMe";
|
||
import { WORKSPACE_PORTAL } from "@/modules/workspace/constants/portals";
|
||
import { Card, CardContent, Button, LoadingState, ErrorState } from "@/components/ds";
|
||
|
||
export const WorkspaceHub = function WorkspaceHubPage() {
|
||
const { me, loading, error, reload } = useMe();
|
||
if (loading) return <LoadingState label="در حال بارگذاری فضای کاری…" />;
|
||
if (error) return <ErrorState message={error} onRetry={reload} />;
|
||
if (!me?.current_tenant_id) {
|
||
return <ErrorState message="برای استفاده از فضای کاری، سازمان فعال لازم است." />;
|
||
}
|
||
|
||
return (
|
||
<div className="mx-auto flex min-h-[70vh] max-w-lg flex-col items-center justify-center gap-6 p-6 text-center">
|
||
<div>
|
||
<h1 className="text-2xl font-bold text-secondary">{WORKSPACE_PORTAL.label}</h1>
|
||
<p className="mt-2 text-sm text-[var(--muted)]">{WORKSPACE_PORTAL.description}</p>
|
||
</div>
|
||
<Card className="w-full">
|
||
<CardContent className="space-y-3 p-6">
|
||
<p className="font-medium">ورود به مرکز کار</p>
|
||
<p className="text-sm text-[var(--muted)]">
|
||
تیمها، پروژهها، وظایف و مدیریت محتوا در یک فضای کاری سازمانی.
|
||
</p>
|
||
<Link href="/workspace/hubs">
|
||
<Button className="w-full">ورود به فضای کاری</Button>
|
||
</Link>
|
||
</CardContent>
|
||
</Card>
|
||
</div>
|
||
);
|
||
};
|
||
|
||
export default WorkspaceHub;
|