import React from 'react' import {FormController, Input, DecimalInput, Button, Checkbox} from '~/components/form' EditItem.getInitialProps = async ({ctx: {axios, query: {slug}}}) => { const {data: item} = await axios.get(`/api/items/by-slug/${slug}`) return {item} } export default function EditItem({item}) { const stringLengthAtLeastOne = str => str.length > 0 const slugRestrictions = str => { if(str.length < 3) return false; if(str.length > 20) return false; if(!str.match(/^[-a-z0-9_]*$/i)) return false; return true; } return ( <>