import { Settings2Icon } from "lucide-react"; import { Button } from "@/components/ui/button.js"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu.js"; import { Switch } from "@/components/ui/switch.js"; import type { IntlShape } from "@/ModelTrajectoryPaneParts.js"; import { TRAJECTORY_EXPANSION_KINDS, type TrajectoryExpansionCommands, } from "@/ModelTrajectoryExpansion.js"; import type { TrajectoryVisualRole } from "@/ModelTrajectoryRoleStyles.js"; export function ModelTrajectoryExpansionMenu({ commands, onToggle, intl, }: { commands: TrajectoryExpansionCommands; onToggle: (kind: TrajectoryVisualRole) => void; intl: IntlShape; }) { const label = intl.formatMessage({ id: "modelTrajectory.customExpansion" }); return ( {TRAJECTORY_EXPANSION_KINDS.map((kind) => ( { event.preventDefault(); onToggle(kind); }} > {expansionKindLabel(kind, intl)} ))} ); } function expansionKindLabel(kind: TrajectoryVisualRole, intl: IntlShape): string { switch (kind) { case "system": case "user": case "assistant": return intl.formatMessage({ id: `modelTrajectory.role.${kind}` }); case "reasoning": return intl.formatMessage({ id: "modelTrajectory.reasoning" }); case "tool-call": return intl.formatMessage({ id: "modelTrajectory.toolCall" }); case "tool-result": return intl.formatMessage({ id: "modelTrajectory.role.tool" }); } }