import { useCallback as i, useMemo as u } from "react";
const m = (e) => {
  const t = i(
    ((r) => {
      if (Array.isArray(r)) {
        const s = new Set(r);
        return e.filter((o) => s.has(o)).map((o) => ({ key: o }));
      }
      const n = e.find((s) => s === r);
      return n ? { key: n } : void 0;
    }),
    [e]
  );
  return u(() => ({ data: e, getItem: t }), [e, t]);
};
export {
  m as u
};
