Convert ToolBar to Typescript
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
import styles from "./ToolBar.module.css"
|
||||
import CreateEventBtn from "./tools/CreateEventBtn/CreateEventBtn.jsx";
|
||||
import CreateEventBtn from "./tools/CreateEventBtn/CreateEventBtn";
|
||||
import SearchBtn from "./tools/SearchBtn";
|
||||
import FilterBtn from "./tools/FilterBtn";
|
||||
|
||||
function ToolBar({setFilters, filters, showCreate = true}) {
|
||||
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>
|
||||
@@ -16,4 +27,4 @@ function ToolBar({setFilters, filters, showCreate = true}) {
|
||||
);
|
||||
}
|
||||
|
||||
export default ToolBar;
|
||||
export default ToolBar;
|
||||
Reference in New Issue
Block a user