import { jsxs as _jsxs } from "react/jsx-runtime";
import { Dialog } from "./design/Dialog.js";
export function costThresholdTone(costUsd, thresholdUsd) {
    if (!Number.isFinite(costUsd) || !Number.isFinite(thresholdUsd) || thresholdUsd <= 0)
        return "warning";
    if (costUsd >= thresholdUsd)
        return "error";
    if (costUsd >= thresholdUsd * 0.75)
        return "warning";
    return "success";
}
export function CostThresholdDialog(props) {
    const tone = costThresholdTone(props.costUsd, props.thresholdUsd);
    return (_jsxs(Dialog, { title: "Cost threshold", statusLabel: tone, statusTone: tone, width: props.width, children: ["Estimated cost $", props.costUsd.toFixed(4), " of $", props.thresholdUsd.toFixed(4), "."] }));
}
