TorbatYar/frontend/modules/workspace/features/hub.tsx
Mortezakoohjani a483b47369 feat(workspace): complete production workspace and content operations
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-12 11:54:17 +03:30

38 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"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;