import Link from 'next/link'
import { listCustomerOptions } from '@/lib/supabaseAdmin'
import NewLicenseForm from './NewLicenseForm'

export default async function NewLicensePage() {
  const customers = await listCustomerOptions()

  return (
    <div className="space-y-6 max-w-2xl">
      <div>
        <Link href="/admin/licenses" className="text-sm text-gray-500 hover:text-gray-900 dark:hover:text-white">← Lisanslar</Link>
        <h2 className="text-2xl font-bold tracking-tight text-gray-900 dark:text-white mt-2">Yeni Lisans Oluştur</h2>
        <p className="text-gray-500 dark:text-gray-400 mt-1">Satış yaptığınızda burada bir lisans anahtarı üretin ve müşteriye iletin.</p>
      </div>

      <NewLicenseForm customers={customers} />
    </div>
  )
}
