implementiran share by link
This commit is contained in:
20
app/[locale]/share/bill/[id]/page.tsx
Normal file
20
app/[locale]/share/bill/[id]/page.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { fetchBillById } from '@/app/lib/actions/billActions';
|
||||
import { ViewBillCard } from '@/app/ui/ViewBillCard';
|
||||
import { Main } from '@/app/ui/Main';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
export default async function Page({ params:{ id } }: { params: { id:string } }) {
|
||||
|
||||
const [locationID, billID] = id.split('-');
|
||||
|
||||
const [location, bill] = await fetchBillById(locationID, billID) ?? [];
|
||||
|
||||
if (!bill || !location) {
|
||||
return(notFound());
|
||||
}
|
||||
return (
|
||||
<Main>
|
||||
<ViewBillCard location={location} bill={bill} />
|
||||
</Main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user