TorbatYar/frontend/modules/delivery/features/hub.tsx
Mortezakoohjani 7978970783 feat(delivery): add Torbat Driver frontend module with real API wiring.
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>
2026-07-27 12:02:01 +03:30

34 lines
1.3 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

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