// components/modals/SetStockModal.tsx import React from 'react' import axios from 'axios' import { toast } from 'react-hot-toast' interface Props { onClose: () => void } const SetStockModal: React.FC = ({ onClose }) => { const [quantity, setQuantity] = React.useState(0) const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() try { await axios.post('/api/set-stock', { quantity }, { withCredentials: true }) toast.success('Stock set!') onClose() } catch { toast.error('Failed to set stock') } } return (

Set Stock

setQuantity(+e.target.value)} className="input input-bordered w-full" required />
) } export default SetStockModal