"use client";
import { jsx, jsxs } from "../../packages/jsx/src/jsx-runtime.js";
import { formatWithNumeral } from "@edgeandnode/common";
import { formatChartDate } from "../../utils/charts.js";
import { BorderRadius } from "../../tokens/BorderRadius.js";
import { Spacing } from "../../tokens/Spacing.js";
import { Flex } from "../../atoms/Flex/Flex.js";
import { Text } from "../../atoms/Text/Text.js";
const ChartTooltip = ({ children }) => /* @__PURE__ */ jsx(
  Flex.Column,
  {
    align: "center",
    gap: Spacing["4px"],
    sx: {
      px: Spacing["16px"],
      py: Spacing["8px"],
      borderRadius: BorderRadius.S,
      border: "White4",
      bg: "Tooltip"
    },
    children
  }
);
const DefChartTooltip = ({
  chartDate,
  chartPositionTotal,
  chartPositionCurrency = "GRT"
}) => {
  const title = typeof chartDate === "number" ? formatChartDate(chartDate) : chartDate;
  const total = typeof chartPositionTotal === "number" ? formatWithNumeral(chartPositionTotal) : chartPositionTotal;
  return /* @__PURE__ */ jsxs(ChartTooltip, { children: [
    /* @__PURE__ */ jsx(Text.C10, { color: "White64", children: title }),
    /* @__PURE__ */ jsxs(Flex.Row, { align: "center", gap: Spacing["4px"], children: [
      /* @__PURE__ */ jsx(Text.P18, { as: "span", children: total }),
      /* @__PURE__ */ jsx(Text.C10, { as: "span", children: chartPositionCurrency })
    ] })
  ] });
};
export {
  ChartTooltip,
  DefChartTooltip
};
