diff --git a/components/select.tsx b/components/select.tsx new file mode 100644 index 0000000..e9f8eff --- /dev/null +++ b/components/select.tsx @@ -0,0 +1,40 @@ +import React from 'react' + +export default function Select({ + label, + value, + onChange, + children, +}: { + label: string + value: string + onChange: (e: React.ChangeEvent) => void + children: React.ReactNode +}) { + return ( +
+
+ +
+ +
+ + + +
+
+
+
+ ) +} diff --git a/pages/booking/[uuid]/bill.tsx b/pages/booking/[uuid]/bill.tsx index e8271a3..a4ce0d3 100644 --- a/pages/booking/[uuid]/bill.tsx +++ b/pages/booking/[uuid]/bill.tsx @@ -3,6 +3,7 @@ import React, { useEffect, useState } from 'react' import Footer from '../../../components/footer' import Header from '../../../components/header' import Input from '../../../components/input' +import Select from '../../../components/select' import { AdditionalCosts, BillDocument } from '../../../db/bill' import { BookingDocument } from '../../../db/booking' import { @@ -13,6 +14,22 @@ import { import { getBookingByUUID } from '../../../db/index' import { dateFormatFrontend } from '../../../helpers/date' +const milageRateOptions = Object.values(MILAGE_RATES).map((rate) => { + return ( + + ) +}) + +const bookingStatusOptions = Object.values(BILL_STATUS).map((status) => { + return ( + + ) +}) + export const getServerSideProps: GetServerSideProps = async (context) => { const { res, @@ -177,73 +194,20 @@ export default function BillPage({ } /> -
-
- -
- -
- - - -
-
-
-
-
-
- -
- -
- - - -
-
-
-
- + + {storingError && (