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

export default async function LocationEditPage({ locationId }: { locationId:string }) {

    const location = await fetchLocationById(locationId);

    if (!location) {
        return(notFound());
    }

    const result = <LocationEditForm location={location} />;
    
    return (result);
}