import { useState as m, useRef as u, useEffect as f, useMemo as n } from "react";
import { deepEqual as l } from "fast-equals";
import { ColumnColorFormatter as s } from "./formatter.js";
import { ColumnColorGroupFormatter as a } from "./ColumnColorGroupFormatter.js";
const d = (r) => {
  const [e, t] = m(r), o = u({ ...r });
  return f(() => {
    l(o.current, r) || (o.current = r, t(r));
  }, [r]), n(
    () => ({
      formatter: s(e),
      renderGroupCell: a(e)
    }),
    [e]
  );
};
export {
  d as useColumnColor
};
