({ params })
| 82 | } |
| 83 | |
| 84 | export async function getStaticProps ({ params }) { |
| 85 | const name = params.name.replace(/-/g," ") |
| 86 | const inventory = await fetchInventory() |
| 87 | const product = inventory.find(item => slugify(item.name) === slugify(name)) |
| 88 | |
| 89 | return { |
| 90 | props: { |
| 91 | product, |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | function ItemViewWithContext(props) { |
| 97 | return ( |
nothing calls this directly
no test coverage detected