import { getServerApi } from '@garage/api/server'
import { EmployeeGeneralInfo } from '@/modules/employees/employee-general-info'
import DashboardPage from '@/base/components/layout/dashboard/dashboard-page'

export default async function page(props: { params: Promise<{ id: string }> }) {
    const { id } = await props.params
    const api = await getServerApi()
    const employee = await api.employees.getById(id)

    if (!employee.data) {
        return <div className="text-muted-foreground">Employee not found.</div>
    }

    return (
        <DashboardPage header={null}>
            <EmployeeGeneralInfo employee={employee.data as any} />
        </DashboardPage>
    )
}
