import { useState } from "react";
var __read = globalThis && globalThis.__read || function(o, n) {
  var m = typeof Symbol === "function" && o[Symbol.iterator];
  if (!m)
    return o;
  var i = m.call(o), r, ar = [], e;
  try {
    while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
      ar.push(r.value);
  } catch (error) {
    e = { error };
  } finally {
    try {
      if (r && !r.done && (m = i["return"]))
        m.call(i);
    } finally {
      if (e)
        throw e.error;
    }
  }
  return ar;
};
function useImageStatus(defaultValue) {
  var _a = __read(useState(defaultValue), 2), status = _a[0], setStatus = _a[1];
  var isBeforeLoad = status === "beforeLoad";
  var isLoading = status === "loading";
  var isError = status === "error";
  var isLoaded = status === "loaded";
  return {
    status,
    isBeforeLoad,
    isLoading,
    isError,
    isLoaded,
    setStatus
  };
}
export {
  useImageStatus as default
};
//# sourceMappingURL=useImageStatus.js.map
