import { jsx as r } from "react/jsx-runtime";
import { Text as i } from "./index-Text.js";
import { useRelativeTimeFormat as s } from "./index-use-relative-time-format.js";
const x = (o) => {
  const {
    children: e,
    fallbackText: n = "Invalid date",
    ...t
  } = o, m = typeof e == "string" ? e : e.toISOString(), {
    text: a,
    replacements: c,
    error: l
  } = s(m);
  return l ? r(i, {
    ...t,
    children: n
  }) : r(i, {
    ...t,
    replacements: c,
    children: a
  });
};
export {
  x as RelativeTime
};
