import type { LucideIcon } from "lucide-react";
import type { ReactNode } from "react";

import {
  ListPageCard,
  type BreadcrumbCrumb,
} from "@/app/dashboard/_components";

import { HubTabNav, type HubTab } from "./hub-tab-nav";

type Props = {
  icon?: LucideIcon;
  title: ReactNode;
  description?: ReactNode;
  actions?: ReactNode;
  breadcrumb?: BreadcrumbCrumb[];
  activeTab: string;
  tabs: readonly HubTab[];
  helperText?: string;
  children: ReactNode;
};

export function HubShell({
  icon,
  title,
  description,
  actions,
  breadcrumb,
  activeTab,
  tabs,
  helperText,
  children,
}: Props) {
  return (
    <ListPageCard
      icon={icon}
      title={title}
      description={description}
      actions={actions}
      breadcrumb={breadcrumb}
      subNav={
        <HubTabNav activeTab={activeTab} tabs={tabs} helperText={helperText} />
      }
    >
      {children}
    </ListPageCard>
  );
}
