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

export default async function LocationViewPage({ locationId }: { locationId:string }) {
    const location = await fetchLocationById(locationId);

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

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