22 lines
734 B
TypeScript
22 lines
734 B
TypeScript
import { notFound } from 'next/navigation';
|
|
import { fetchLocationById } from '@/app/lib/actions/locationActions';
|
|
import { LocationDeleteForm } from '@/app/ui/LocationDeleteForm';
|
|
import { BillDeleteForm } from '@/app/ui/BillDeleteForm';
|
|
import { fetchBillById } from '@/app/lib/actions/billActions';
|
|
import { Main } from '@/app/ui/Main';
|
|
|
|
export default async function Page({ params:{ id } }: { params: { id:string } }) {
|
|
const [locationID, billID] = id.split('-');
|
|
|
|
const [location, bill] = await fetchBillById(locationID, billID) ?? [];
|
|
|
|
if (!location || !bill) {
|
|
return(notFound());
|
|
}
|
|
|
|
return (
|
|
<Main>
|
|
<BillDeleteForm location={location} bill={bill} />
|
|
</Main>
|
|
);
|
|
} |