import { memo, useMemo, createElement, Fragment } from "react";
import { useEnvironment } from "@contember/binding";
const Variable = memo(({ name, format }) => {
  const environment = useEnvironment();
  const value = environment.getVariableOrElse(name, void 0) ?? environment.getParameter(name);
  const formatted = useMemo(() => format ? format(value) : value, [format, value]);
  return /* @__PURE__ */ createElement(Fragment, null, formatted);
});
Variable.displayName = "Variable";
export { Variable };
//# sourceMappingURL=Variable.js.map
