import { Effect } from "effect";
import { getLocalizedText } from "../../../../share/locale.js";
import { interpolateMarkdown } from "../../../../share/interpolate.js";
import { reject } from "../../../../composables/useOverlay.js";
class AlertCancelled {
  _tag = "AlertCancelled";
}
export const handler = (params, ctx) => Effect.gen(function* () {
  const { message, icon, color } = params ?? {};
  const raw = getLocalizedText(message, ctx.locale()) ?? "";
  const content = interpolateMarkdown(raw, ctx.cel);
  const cancelled = yield* reject({ content, icon, color });
  if (cancelled) return yield* Effect.die(new AlertCancelled());
});
