import React, { useState } from 'react' import { Container, Paper, Col, Table, Button, TextInput, useMantineTheme } from '@mantine/core' interface InventoryItem { id: number name: string price: number quantity: number } 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('') } 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)} />
) }