17 lines
563 B
TypeScript
17 lines
563 B
TypeScript
"use client";
|
|
|
|
import type { ComponentPropsWithoutRef } from "react";
|
|
import { IoMenuOutline, IoCloseOutline } from "react-icons/io5";
|
|
import { IconButton } from "@/components/IconButton";
|
|
|
|
type MenuToggleButtonProps = Omit<ComponentPropsWithoutRef<"button">, "aria-label"> & {
|
|
open: boolean;
|
|
};
|
|
|
|
export function MenuToggleButton({ open, ...props }: MenuToggleButtonProps) {
|
|
return (
|
|
<IconButton aria-label={open ? "Close menu" : "Open menu"} aria-expanded={open} {...props}>
|
|
{open ? <IoCloseOutline /> : <IoMenuOutline />}
|
|
</IconButton>
|
|
);
|
|
}
|