import { getServerApi } from '@garage/api/server'
import { CreditNoteGeneralInfo } from '@/modules/credit-notes/credit-note-general-info'

export default async function CreditNoteDetailPage(props: { params: Promise<{ id: string }> }) {
    const { id } = await props.params
    const api = await getServerApi()
    const response = await api.creditNotes.show(id)
    const creditNote = (response as any)?.data ?? response

    return (
        <div className="p-4 lg:p-6">
            <CreditNoteGeneralInfo creditNote={creditNote} />
        </div>
    )
}
