import { AppShell } from '@/components/app/app-shell'
import { requireRoleRoute } from '@/lib/role-route'
import { NewTripForm } from './new-trip-form'

/**
 * Freight Broker · New Trip — `/fb-new-trip` (Nash, 2026-09-13: "depending
 * from which dashboard you click on the button, the right link should open").
 * The broker's own workspace for a load — no carrier or driver needed.
 */
export default async function FreightBrokerNewTripPage() {
  const { profile } = await requireRoleRoute('broker')
  return (
    <AppShell profile={profile}>
      <main className="mx-auto max-w-2xl px-4 py-8">
        <h1 className="text-2xl font-bold tracking-tight">Create a trip</h1>
        <p className="mt-1 text-sm text-neutral-600">
          Your own workspace for this load — no carrier or driver needed. Upload the rate
          confirmation and permits right after, and invite people whenever you are ready.
        </p>
        <NewTripForm />
      </main>
    </AppShell>
  )
}
