import { c as _c } from "react/compiler-runtime";
import { memo } from "react";
import FormattedNumber from "./FormattedNumber";
const style = {
  wordBreak: "keep-all"
};
const formatter = new Intl.NumberFormat("de");

/**
 * Base-component that just displays a score. If you need to handle logic with hidden scores, use `MaybeHiddenScore`.
 *
 * Using <Score />, the score is never hidden. This is useful for displaying scores in the Profile etc.
 */
export default memo(function Score(props) {
  const $ = _c(7);
  const score = typeof props.score !== "undefined" ? props.score : props.up - props.down;
  const t0 = props.score === undefined ? `${formatter.format(props.up)} plus, ${formatter.format(props.down)} minus` : undefined;
  let t1;
  if ($[0] !== props.compact || $[1] !== score) {
    t1 = <FormattedNumber value={score} compact={props.compact} />;
    $[0] = props.compact;
    $[1] = score;
    $[2] = t1;
  } else {
    t1 = $[2];
  }
  const t2 = props.showUnit && " Benis";
  let t3;
  if ($[3] !== t0 || $[4] !== t1 || $[5] !== t2) {
    t3 = <span title={t0} style={style}>{t1}{t2}</span>;
    $[3] = t0;
    $[4] = t1;
    $[5] = t2;
    $[6] = t3;
  } else {
    t3 = $[6];
  }
  return t3;
});
//# sourceMappingURL=Score.jsx.map