import "../styles/Filters.css"; import { useState } from "react"; import { AwesomeButton } from "react-awesome-button"; import "react-awesome-button/dist/themes/theme-blue.css"; const Filters = ({ filterCheckbox, handleFilterCheckbox, sortBy, sort, onExit, }) => { const [nameChecked, setNameChecked] = useState(filterCheckbox[0]), [titleChecked, setTitleChecked] = useState(filterCheckbox[1]), [tagChecked, setTagChecked] = useState(filterCheckbox[2]), [radio, setRadio] = useState(sort); function abort(e) { if (e.target.className === "filter-overlay") { onExit(); } } function handleRadio(e) { setRadio(e.target.value); } function applyChanges() { handleFilterCheckbox([nameChecked, titleChecked, tagChecked]); sortBy(radio); } return ( <>

Filter Results

Sort By

Include/Exclude

Apply 
); }; export default Filters;