import type { ReactNode } from "react";

import { AppCard } from "@/components/ui/app-card";
import { CardContent } from "@/components/ui/card";

type AppHeaderProps = {
  title: string;
  description?: string;
  actions?: ReactNode;
};

export function AppHeader({ title, description, actions }: AppHeaderProps) {
  return (
    <AppCard level={3}>
      <CardContent className="flex flex-wrap items-start justify-between gap-5 p-6 lg:p-8">
        <div className="space-y-2">
          <h1 className="text-3xl font-semibold tracking-tight text-foreground sm:text-4xl">
            {title}
          </h1>
          {description ? (
            <p className="max-w-3xl text-sm text-muted-foreground sm:text-base">
              {description}
            </p>
          ) : null}
        </div>
        {actions ? <div className="flex items-center gap-2">{actions}</div> : null}
      </CardContent>
    </AppCard>
  );
}
