You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.2 KiB
JavaScript

import React, {useState} from 'react'
import Router from 'next/router'
import ActionBar from '~/components/admin/actionBar'
import {FormController, DateInput, TextArea, Button} from '~/components/form'
EnterDelivery.getInitialProps = async ({ctx: {axios, query: {id}}}) => {
const {data: order} = await axios.get(`/api/orders/${id}`)
return {order}
}
export default function EnterDelivery({order}){
return (
<>
<ActionBar title="Mark Delivered"/>
<FormController afterSubmit={() => Router.push(`/admin/orders/${order.uuid}`)} url={`/api/orders/${order.uuid}/ship/delivery`}>
<p>Use this to enter delivery information for packages delivered in-person or at a con.</p>
<p>In case we ever have future corespondence with this person, please be sure to describe where, when, and to who you gave the package.</p>
<TextArea label="Description" validate={val => val.length > 0} type="text" name="description" hint="Please describe how and where you delivered the order to them" />
<DateInput label="Delivery Date" placeholder="Today" name="date" />
<Button type="submit">Submit</Button>
</FormController>
</>
)
}