Ship the delivery platform UI under modules/delivery with thin app routes, BFF proxy, CRUD for phase 10.0-10.1 APIs, and capability-gated future screens. Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
1.3 KiB
TypeScript
34 lines
1.3 KiB
TypeScript
"use client";
|
||
|
||
import Link from "next/link";
|
||
import { useMe } from "@/hooks/useMe";
|
||
import { DELIVERY_PORTAL } from "@/modules/delivery/constants/portals";
|
||
import { Card, CardContent, Button, LoadingState, ErrorState } from "@/components/ds";
|
||
|
||
export const DeliveryHub = function DeliveryHubPage() {
|
||
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">{DELIVERY_PORTAL.label}</p>
|
||
<p className="text-sm text-[var(--muted)]">{DELIVERY_PORTAL.description}</p>
|
||
<Link href={DELIVERY_PORTAL.basePath}>
|
||
<Button className="w-full">ورود به پنل عملیات</Button>
|
||
</Link>
|
||
</CardContent>
|
||
</Card>
|
||
</div>
|
||
);
|
||
};
|
||
|
||
export default DeliveryHub;
|