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

export const LocationDeletePage = async ({ locationId }: { locationId:string }) => {

    const location = await fetchLocationById(locationId);

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

    return (<LocationDeleteForm location={location} />);
}