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