import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { Box, Text } from "ink";
import { isChineseUi } from "../services/ui/languageService.js";
import { PRODUCT_NAME } from "../constants/product.js";
import { StatusBadge } from "./design/StatusBadge.js";
import { toneColor } from "./design/terminalTheme.js";
import { FastIcon, isFastModel } from "./FastIcon.js";
export function Header(props) {
    const zh = isChineseUi(props.config.language);
    return (_jsxs(Box, { justifyContent: "space-between", paddingX: 1, paddingBottom: 1, children: [_jsxs(Box, { children: [_jsx(Text, { color: toneColor("brand"), bold: true, children: PRODUCT_NAME }), _jsx(Text, { color: "gray", children: ` ${compactPath(props.config.projectPath, 48)}` })] }), _jsxs(Box, { children: [isFastModel(props.config.model) && (_jsxs(_Fragment, { children: [_jsx(FastIcon, {}), _jsx(Text, { children: " " })] })), _jsx(StatusBadge, { label: props.provider ? (zh ? "就绪" : "ready") : (zh ? "缺失" : "missing"), tone: props.provider ? "success" : "warning" }), _jsx(Text, { color: "gray", children: ` ${props.config.model}` })] })] }));
}
function compactPath(value, max) {
    if (value.length <= max)
        return value;
    return `...${value.slice(-(max - 3))}`;
}
