"use client";

import { PageHeader } from "@/components/ds";
import { useTenantId } from "@/hooks/useTenantId";
import { CrmCountsGrid, CrmPageLoader } from "@/modules/crm/pages/shared";
import { CrmBreadcrumbs } from "@/modules/crm/components/CrmBreadcrumbs";
import { CrmScopeNotice } from "@/modules/crm/components/CrmScopeNotice";

export default function AnalyticsPage() {
  const { tenantId } = useTenantId();
  if (!tenantId) return <CrmPageLoader />;

  return (
    <div>
      <CrmBreadcrumbs items={[{ label: "تحلیل‌ها" }]} />
      <PageHeader
        title="تحلیل CRM"
        description="Dashboard تحلیلی از داده real-time lists — AnalyticsProvider فقط contract."
      />
      <CrmCountsGrid tenantId={tenantId} />
      <div className="mt-6">
        <CrmScopeNotice
          title="Analytics engine خارج از CRM"
          description="CRM events را publish می‌کند؛ BI/Analytics warehouse در این فاز UI ندارد."
        />
      </div>
    </div>
  );
}
