import styles from "./ToolBar.module.css"
import CreateEventBtn from "./tools/CreateEventBtn/CreateEventBtn";
import SearchBtn from "./tools/SearchBtn";
import FilterBtn from "./tools/FilterBtn";

interface Filters {
    alphabetical: "asc" | "desc";
    yearOrder: "asc" | "desc";
}

interface ToolBarProps {
    setFilters: React.Dispatch<React.SetStateAction<Filters>>;
    filters: Filters;
    showCreate?: boolean;
}

function ToolBar({ setFilters, filters, showCreate = true }: ToolBarProps) {

    return (
        <div>
            <div className={styles.eventsButtons}>
                {showCreate && <CreateEventBtn />}
                <SearchBtn />
                <FilterBtn setFilters={setFilters} filters={filters} />
            </div>
        </div>
    );
}

export default ToolBar;
