import {type FunctionComponent} from 'react'
import ContactDetailForm from '@/app/authenticated/contacts/contactId/edit/contactDetailForm'
import {getContact} from '@/dal/contacts'

interface ContactEditPageProps {
  params: Promise<{
    contactId: string
  }>
}

const ContactEditPageProps: FunctionComponent<ContactEditPageProps> = async ({params}) => {
  const {contactId} = await params
  const contact = await getContact(contactId)

  return <ContactDetailForm {...contact} />
}

export default ContactEditPageProps
