TorbatYar/frontend/modules/hospitality/features/hub.tsx
Mortezakoohjani 065c053c16 Add complete Torbat Food hospitality frontend connected to backend APIs.
Introduces modules/hospitality with 54 routes, BFF proxy, capability-gated nav, CRUD factory, and architecture validation docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 20:54:26 +03:30

34 lines
1.4 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 { HOSPITALITY_PORTAL } from "@/modules/hospitality/constants/portals";
import { Card, CardContent, Button, LoadingState, ErrorState } from "@/components/ds";
export const HospitalityHub = function HospitalityHubPage() {
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="برای استفاده از تربت فود workspace فعال لازم است." />;
}
return (
<div className="mx-auto max-w-lg p-6">
<h1 className="mb-2 text-2xl font-bold text-secondary">تربت فود</h1>
<p className="mb-6 text-sm text-[var(--muted)]">پلتفرم مهماننوازی سازمانی</p>
<Card>
<CardContent className="space-y-4 p-6">
<p className="font-medium">{HOSPITALITY_PORTAL.label}</p>
<p className="text-sm text-[var(--muted)]">{HOSPITALITY_PORTAL.description}</p>
<Link href={HOSPITALITY_PORTAL.basePath}>
<Button className="w-full">ورود به پنل مدیریت</Button>
</Link>
</CardContent>
</Card>
</div>
);
};
export default HospitalityHub;