import React, {useState} from 'react' import Head from 'next/head' import Router from 'next/router' import {FormController, NumInput, Button} from '~/components/form' import isNum from 'validator/lib/isNumeric' import styles from './style.module.css' Item.getInitialProps = async function({ctx: {axios, query: {slug}}}){ const {data: item} = await axios.get(`/api/items/by-slug/${slug}`) if(!item) { const err = new Error("Not found") err.status = 404 throw err; } return {item} } // TODO: Modal with full image size on clicking preview export default function Item({item, cart, setCart}){ // Pick first one with featured flag or 0 const featuredIndex = item.images.reduce((p, im, i) => ((p !== undefined) ? p : (im.featured ? i : undefined)), undefined) || 0 const [selectedIndex, setSelected] = useState(featuredIndex); const numInCart = cart?.items?.find(i => i.item.uuid === item.uuid)?.count || 0 return ( <>
{p}
) }All socks are only available in adult medium sizes (approximately US Men's size 10 - 13 depending on stretching) at the moment - we're working on getting more sizes available but not quite ready for that yet.
All purchases are shipped within a few days of your purchase, (USPS first class).