Files
pfadi-bussle/pages/admin/index.tsx
2024-09-13 22:55:10 +02:00

29 lines
753 B
TypeScript

import React, { ReactElement } from 'react'
import BookingTable from '../../components/bookingTable'
import Layout from '../../components/layout'
import withAuth from '../../helpers/withAuth'
import { getServerSideRecentBookings } from '../../lib/getServerSideProps'
export const getServerSideProps = getServerSideRecentBookings
function AdminRecentBookings({ bookings }) {
if (!bookings || !bookings.length) {
return (
<h3 className="text-lg leading-6 font-medium text-gray-900">
No recent bookings 😿
</h3>
)
}
return (
<Layout>
{bookings.map((booking: any) => (
<BookingTable key={booking.uuid} booking={booking} />
))}
</Layout>
)
}
export default withAuth(AdminRecentBookings)