import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Box, Text } from "ink";
import { SelectList } from "./design/SelectList.js";
export function messageActionOptions(item) {
    const isUser = item.role === "user";
    const isAssistant = item.role === "assistant";
    const isTool = item.role === "tool" || item.role === "tool-start";
    return [
        { id: "copy", label: "Copy", detail: "copy message text", selected: true, tone: "brand" },
        { id: "retry", label: "Retry", detail: "retry from this turn", disabled: !isUser && !isAssistant, tone: "warning" },
        { id: "rewind", label: "Rewind", detail: "checkpoint restore flow", disabled: !isUser, tone: "error" },
        { id: "compact", label: "Compact", detail: "summarize older context", tone: "success" },
        { id: "inspect", label: "Inspect", detail: isTool ? "open tool details" : "show message metadata", tone: "muted" },
    ];
}
export function MessageActions(props) {
    return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "cyan", children: "Message actions" }), _jsx(SelectList, { options: messageActionOptions(props.item), width: props.width, visibleCount: 5 })] }));
}
