import { BillingLocation, Bill } from '@/app/lib/db-types';
import { fetchBillById } from '@/app/lib/billActions';
import clientPromise from '@/app/lib/mongodb';
import { BillEditForm } from '@/app/ui/BillEditForm';
import { ObjectId } from 'mongodb';
import { notFound } from 'next/navigation';
import { LocationEditForm } from '@/app/ui/LocationEditForm';
import { fetchLocationById } from '@/app/lib/locationActions';

export default async function Page({ params:{ id } }: { params: { id:string } }) {

    const location = await fetchLocationById(id);

    if (!location) {
        return(notFound());
    }
    return (<LocationEditForm location={location} />);
}