Add skeleton for dropdown component

This commit is contained in:
Hannah 2026-09-28 16:44:57 +02:00
commit 73c49252f6
2 changed files with 25 additions and 0 deletions

View file

@ -1,6 +1,7 @@
"use client";
import Button from "@/components/ui/Button";
import Dropdown from "@/components/ui/Dropdown";
import Form from "@/components/ui/Form";
import NavLink from "@/components/ui/NavLink";
import RoundedContainer from "@/components/ui/RoundedContainer";
@ -48,6 +49,11 @@ export default function Components() {
<p>More Contents</p>
</div>
</RoundedContainer>
<h1>Dropdown</h1>
<Dropdown>
<p>Hello!</p>
</Dropdown>
</div>
);
}

View file

@ -0,0 +1,19 @@
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>
);
}