19 lines
430 B
TypeScript
19 lines
430 B
TypeScript
import { useState } from "react";
|
|
import Button from "./Button";
|
|
|
|
export default function Dropdown({ children }: { children: React.ReactNode }) {
|
|
const [dropped, setDropped] = useState<boolean>(false);
|
|
|
|
return (
|
|
<div>
|
|
<Button
|
|
title="Drop down"
|
|
mode="DARK"
|
|
onClick={() => {
|
|
setDropped(!dropped);
|
|
}}
|
|
></Button>
|
|
{dropped && <div>{children}</div>}
|
|
</div>
|
|
);
|
|
}
|