import { AppShell } from "@/components/app-shell"
import { SiteHeader } from "@/components/site-header"
import { IncidentWorkspace } from "@/components/incidents/incident-workspace"

export default async function IncidentesPage({
  searchParams,
}: {
  searchParams: Promise<Record<string, string | string[] | undefined>>
}) {
  const params = await searchParams
  const autoOpen = params?.quick === "new"

  return (
    <AppShell
      header={<SiteHeader title="Incidentes" lead="Comunicação e resposta a major incidents" />}
    >
      <div className="space-y-6 px-4 py-6 lg:px-6">
        <IncidentWorkspace autoOpenDrawer={autoOpen} />
      </div>
    </AppShell>
  )
}
