waveterm/frontend/app/element/menubutton.tsx
Mike Sawka d272a4ec03
New AIPanel (#2370)
Massive PR, over 13k LOC updated, 128 commits to implement the first pass at the new Wave AI panel.  Two backend adapters (OpenAI and Anthropic), layout changes to support the panel, keyboard shortcuts, and a huge focus/layout change to integrate the panel seamlessly into the UI.

Also fixes some small issues found during the Wave AI journey (zoom fixes, documentation, more scss removal, circular dependency issues, settings, etc)
2025-10-07 13:32:10 -07:00

25 lines
948 B
TypeScript

import clsx from "clsx";
import { memo, useState } from "react";
import { Button } from "./button";
import { FlyoutMenu } from "./flyoutmenu";
import "./menubutton.scss";
const MenuButtonComponent = ({ items, className, text, title }: MenuButtonProps) => {
const [isOpen, setIsOpen] = useState(false);
return (
<div className={clsx("menubutton", className)}>
<FlyoutMenu items={items} onOpenChange={setIsOpen}>
<Button
className="grey rounded-[3px] py-[2px] px-[2px]"
style={{ borderColor: isOpen ? "var(--accent-color)" : "transparent" }}
title={title}
>
<div>{text}</div>
<i className="fa-sharp fa-solid fa-angle-down"></i>
</Button>
</FlyoutMenu>
</div>
);
};
export const MenuButton = memo(MenuButtonComponent) as typeof MenuButtonComponent;