"use client";

import { PageTransition } from "@/components/motion/PageTransition";
import { AdminDashboardOverview } from "@/components/dashboard/AdminDashboardOverview";
import { ClientDashboardHome } from "@/components/client/ClientDashboardHome";
import { DashboardPage } from "@/components/dashboard/DashboardPage";
import { useAuthStore } from "@/store/authStore";

export default function DashboardHomePage() {
  const user = useAuthStore((s) => s.user);
  const isClient = user?.role === "client" || user?.role === "partner";

  if (isClient) {
    return (
      <DashboardPage title="Dashboard">
        <PageTransition>
          <ClientDashboardHome />
        </PageTransition>
      </DashboardPage>
    );
  }

  return (
    <DashboardPage title="Dashboard" executive>
      <PageTransition>
        <AdminDashboardOverview />
      </PageTransition>
    </DashboardPage>
  );
}
