import { notFound } from 'next/navigation'
import BillingSettingsView from '@/views/clients/BillingSettingsView'

const LEGAL_SERVICE = process.env.LEGAL_SERVICE_URL ?? 'http://localhost:3200'

export default async function BillingSettingsPage({ params }: { params: Promise<{ lang: string; id: string }> }) {
  const { lang, id } = await params
  const res = await fetch(`${LEGAL_SERVICE}/client-folders/${id}`, { cache: 'no-store' })
  if (!res.ok) notFound()
  const folder = await res.json()
  return <BillingSettingsView folder={folder} lang={lang} />
}
