Feat: Add DropdownButton prop type
This commit is contained in:
parent
6240991e0c
commit
da703d65e3
3 changed files with 9 additions and 2 deletions
|
|
@ -1,12 +1,13 @@
|
|||
import { useState } from "react";
|
||||
import IconComponent from "../genericIconComponent";
|
||||
import { Button } from "../ui/button";
|
||||
import { dropdownButtonPropsType } from "../../types/components";
|
||||
|
||||
export default function DropdownButton({
|
||||
firstButtonName,
|
||||
onFirstBtnClick,
|
||||
options,
|
||||
}): JSX.Element {
|
||||
}: dropdownButtonPropsType): JSX.Element {
|
||||
const [showOptions, setShowOptions] = useState(false);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ export default function HomePage(): JSX.Element {
|
|||
navigate("/flow/" + id);
|
||||
});
|
||||
}}
|
||||
options={[{name: "yesyes", onBtnClick: () => console.log('dips')}, {name: "dips", onBtnClick: () => console.log('yesyes')}]}
|
||||
options={[{name: "Import from JSON", onBtnClick: () => console.log('imported')}]}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -544,3 +544,9 @@ export type fetchErrorComponentType = {
|
|||
message: string;
|
||||
description: string;
|
||||
};
|
||||
|
||||
export type dropdownButtonPropsType = {
|
||||
firstButtonName: string;
|
||||
onFirstBtnClick: () => void;
|
||||
options: Array<{ name: string; onBtnClick: () => void; }>;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue