import { notFound } from 'next/navigation';
import { LocationEditForm } from '@/app/ui/LocationEditForm';
import { fetchLocationById } from '@/app/lib/actions/locationActions';

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

    const location = await fetchLocationById(id);

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