<script setup>
import { Effect } from "effect";
import { cel as _rawCel } from "../../../../../utils/cel";
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
import ShwfedActionDefinition from "../../../components/definition.vue";
import { dispatchTriggers, useEventChannel } from "../../../../../share/event-bus";
defineOptions({ name: "ShwfedEventDispatchActionRuntime" });
const props = defineProps({
  buttonId: { type: String, required: true },
  config: { type: null, required: true }
});
const inherited = injectCELContext();
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
const channel = useEventChannel();
const effect = Effect.suspend(() => dispatchTriggers(channel, props.config.triggers, $cel));
</script>

<template>
  <ShwfedActionDefinition
    :action-id="buttonId"
    :effect="effect"
  />
</template>
