"use client";
import Link from "next/link";
import { AppStoreGrid } from "@/components/AppStoreGrid";
import { TenantSitePage } from "@/components/TenantSitePage";
import { Badge, Button, Container } from "@/components/ui";
import { PLATFORM_APPS } from "@/lib/apps-catalog";
import { useAuth } from "@/hooks/useAuth";
import { useTenantHost } from "@/hooks/useTenantHost";
import { useTheme } from "@/hooks/useTheme";
export default function HomePage() {
const host = useTenantHost();
if (host.isTenantHost) {
return ;
}
return ;
}
const FEATURES = [
{ icon: "🔐", label: "ورود واحد SSO" },
{ icon: "🏢", label: "چند کسبوکار" },
{ icon: "☁️", label: "ابری و مقیاسپذیر" },
{ icon: "🎨", label: "White-label" },
];
function PlatformHomePage() {
const { theme } = useTheme();
const { isAuthenticated, login, loading } = useAuth();
const siteName = theme?.site_name ?? "Torbatyar";
const availableCount = PLATFORM_APPS.filter((app) => app.status === "available").length;
const quickApps = PLATFORM_APPS.filter((app) => app.status === "available" && app.href).slice(0, 4);
return (
{/* Hero */}
نسل جدید SuperApp
{siteName}
یک پلتفرم، دهها سرویس — حسابداری، CRM، سلامت، زیبایی و بیشتر.
همه با یک ورود واحد.
{isAuthenticated ? (
) : (
)}
{/* Stats */}
{availableCount}+
اپلیکیشن فعال
{/* Quick access chips */}
دسترسی سریع
{quickApps.map((app) => (
{app.icon}
{app.name}
))}
{/* Features strip */}
{FEATURES.map((f) => (
{f.icon}
{f.label}
))}
{/* App grid */}
{/* Footer */}
);
}