mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-11-28 05:00:26 +08:00
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)
25 lines
948 B
TypeScript
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;
|