// Copyright (C) 2022-present Daniel31x13 // This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3. // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. // You should have received a copy of the GNU General Public License along with this program. If not, see . import React, { useState } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faPlus, faTrashCan } from "@fortawesome/free-solid-svg-icons"; import { ExtendedCollection } from "@/types/global"; import useCollectionStore from "@/store/collections"; import { useRouter } from "next/router"; type Props = { toggleDeleteCollectionModal: Function; collection: ExtendedCollection; }; export default function AddCollection({ toggleDeleteCollectionModal, collection, }: Props) { const [inputField, setInputField] = useState(""); const { removeCollection } = useCollectionStore(); const router = useRouter(); const submit = async () => { const response = await removeCollection(collection.id); if (response) { toggleDeleteCollectionModal(); router.push("/collections"); } }; return (

Delete Collection

To confirm, type " {collection.name}" in the box below:

setInputField(e.target.value)} type="text" placeholder={`Type "${collection.name}" Here.`} className=" w-72 sm:w-96 rounded-md p-3 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" />
Delete Collection
); }