"use client" import React, { useState } from 'react' import { Box, Container, Paper, Table, Button, TextInput, useMantineTheme, Flex, Image, Grid } from '@mantine/core' import Example from './query' // import { Image as NextImage } from 'next/image' import NextImage from 'next/image' import Prawn from "../images/aussietigerprawns.jpg" // import Prawn from "/aussietigerprawns.jpg" interface InventoryItem { id: number name: string price: number quantity: number } async function fetchBlob(url: string) { const response = await fetch(url) // Here is the significant part // reading the stream as a blob instead of json return response.blob() } export default function InventoryPage() { const theme = useMantineTheme() const [items, setItems] = useState([]) const [name, setName] = useState('') const [price, setPrice] = useState('') const [quantity, setQuantity] = useState('') const addItem = () => { setItems([ ...items, { id: items.length + 1, name, price: parseFloat(price), quantity: parseInt(quantity), }, ]) setName('') setPrice('') setQuantity('') } const [imageSourceUrl, setImageSourceUrl] = React.useState("") const downloadImageAndSetSource = async (imageUrl: any) => { const image = await fetchBlob(imageUrl) setImageSourceUrl(URL.createObjectURL(image)) } return ( {items.map((item) => ( ))}
ID Name Price Quantity
{item.id} {item.name} {item.price} {item.quantity}
setName(event.currentTarget.value)} /> setPrice(event.currentTarget.value)} /> setQuantity(event.currentTarget.value)} />
{/* */} {/* maybe instead, do 4 items on small. And double each time To 8 or 16 */} {/* */} {/* */} {/* hi */} 1 2 3 4 {/* would fetch the source from axios */} {/* */} {/* */} {/* TIGER PRAWNS */} {/* from public import everything .jpg */} {/* create an Image for each */} {/* */}
) }