import { headers } from 'next/headers'
import { redirect } from 'next/navigation'
import { resolveServerAppUrl } from '@/lib/appUrls'

export default function CompanyWorkspacePage() {
  const requestHeaders = headers()
  const dashboardUrl = resolveServerAppUrl(
    process.env.NEXT_PUBLIC_DASHBOARD_URL ?? 'http://localhost:3001',
    requestHeaders.get('host'),
    requestHeaders.get('x-forwarded-proto'),
  )

  redirect(`${dashboardUrl}/dashboard`)
}
