import type { ReactNode } from 'react'

export function PageHeader({
  title,
  description,
  subtitle,
  actions,
}: {
  title: string
  description?: string
  subtitle?: string
  actions?: ReactNode
}) {
  return (
    <div className="mb-7 flex flex-wrap items-start justify-between gap-4">
      <div>
        <div className="mb-2 flex flex-wrap items-baseline gap-3">
          <h1 className="m-0 text-2xl font-bold leading-tight tracking-tight text-[var(--text-primary)]">
            {title}
          </h1>
          {subtitle ? <span className="text-[13px] text-[var(--text-muted)]">{subtitle}</span> : null}
        </div>
        <div className="h-[3px] w-8 rounded-sm bg-[var(--bg-accent)]" />
        {description ? <p className="mt-2.5 text-sm text-[var(--text-muted)]">{description}</p> : null}
      </div>
      {actions ? <div className="flex shrink-0 flex-wrap items-center gap-1.5">{actions}</div> : null}
    </div>
  )
}
