Location Edit/Add/Delete form migrated back to server-side component
This commit is contained in:
@@ -1,17 +1,14 @@
|
||||
import { Main } from '@/app/ui/Main';
|
||||
import dynamic from 'next/dynamic'
|
||||
|
||||
const LocationDeletePage = dynamic(
|
||||
() => import('./LocationDeletePage'),
|
||||
{ ssr: false }
|
||||
)
|
||||
|
||||
import { notFound } from 'next/navigation';
|
||||
import { fetchLocationById } from '@/app/lib/actions/locationActions';
|
||||
import { LocationDeleteForm } from '@/app/ui/LocationDeleteForm';
|
||||
|
||||
export default async function Page({ params:{ id } }: { params: { id:string } }) {
|
||||
|
||||
return (
|
||||
<Main>
|
||||
<LocationDeletePage locationId={id} />
|
||||
</Main>
|
||||
);
|
||||
const location = await fetchLocationById(id);
|
||||
|
||||
if (!location) {
|
||||
return(notFound());
|
||||
}
|
||||
|
||||
return (<LocationDeleteForm location={location} />);
|
||||
}
|
||||
Reference in New Issue
Block a user