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.

25 lines
910 B
JavaScript

import React, {useState} from 'react'
import Router from 'next/router'
import ActionBar from '~/components/admin/actionBar'
import {FormController, DateInput, Input, Button} from '~/components/form'
EnterTracking.getInitialProps = async ({ctx: {query: {id}}}) => {
return {uuid: id}
}
export default function EnterTracking({uuid}){
return (
<>
<ActionBar title="Enter Tracking"/>
<FormController afterSubmit={() => Router.push(`/admin/orders/${uuid}`)} url={`/api/orders/${uuid}/ship/tracking`}>
<p>Use this to enter tracking information for packages shipped by-hand (via USPS)</p>
<Input label="Tracking Code" validate={val => val.length > 0} type="text" name="code" hint="Please enter the USPS Tracking code" />
<DateInput label="Ship Date" placeholder="Today" name="date" />
<Button type="submit">Submit</Button>
</FormController>
</>
)
}