import { jsx, Fragment } from "react/jsx-runtime";
import { useEnvironment } from "@contember/react-binding";
import { memo, useMemo } from "react";
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__ */ jsx(Fragment, { children: formatted });
});
Variable.displayName = "Variable";
export {
  Variable
};
//# sourceMappingURL=Variable.js.map
