// 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 { AccountSettings } from "@/types/global"; import { faPenToSquare } from "@fortawesome/free-regular-svg-icons"; type Props = { togglePasswordFormModal: Function; user: AccountSettings; setPasswordForm: Function; }; export default function AddCollection({ togglePasswordFormModal, user, setPasswordForm, }: Props) { const [oldPassword, setOldPassword] = useState(""); const [newPassword1, setNewPassword1] = useState(""); const [newPassword2, setNewPassword2] = useState(""); const submit = async () => { if (oldPassword !== "" && newPassword1 !== "" && newPassword2 !== "") { if (newPassword1 === newPassword2) { setPasswordForm(oldPassword, newPassword1); togglePasswordFormModal(); } else { console.log("Passwords do not match."); } } else { console.log("Please fill out all the fields."); } }; return (

Change Password

Old Password

setOldPassword(e.target.value)} type="text" className="w-full rounded-md p-3 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" />

New Password

setNewPassword1(e.target.value)} type="text" className="w-full rounded-md p-3 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" />

Re-enter New Password

setNewPassword2(e.target.value)} type="text" className="w-full rounded-md p-3 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100" />
Change Password
); }