diff --git a/frontend/src/pages/PartDetails.tsx b/frontend/src/pages/PartDetails.tsx index 6edacb68..340cffb5 100644 --- a/frontend/src/pages/PartDetails.tsx +++ b/frontend/src/pages/PartDetails.tsx @@ -27,16 +27,21 @@ const PartDetails = () => { const { addAlert } = useAlertQueue(); const auth = useAuthentication(); const auth_api = new api(auth.api); + const [userId, setUserId] = useState(null); const { id } = useParams(); const [show, setShow] = useState(false); const [ownerEmail, setOwnerEmail] = useState(null); const [part, setPart] = useState(null); const [imageIndex, setImageIndex] = useState(0); const [error, setError] = useState(null); + const [showDelete, setShowDelete] = useState(false); const handleClose = () => setShow(false); const handleShow = () => setShow(true); + const handleShowDelete = () => setShowDelete(true); + const handleCloseDelete = () => setShowDelete(false); + useEffect(() => { const fetchPart = async () => { try { @@ -219,6 +224,82 @@ const PartDetails = () => { + <> + {/* {part.owner === userId && ( */} + {part.owner === part.owner && ( + <> + + + + + + + + + + + + Are you sure you want to delete this part? + + + + + + + + + )} + ); };