<script setup>
import { Effect } from "effect";
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 channel = useEventChannel();
const effect = Effect.suspend(() => dispatchTriggers(channel, props.config.triggers));
</script>

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