<script setup>
import { computed } from "vue";
import { useI18n } from "vue-i18n";
import { cel as _rawCel } from "../../../../../utils/cel";
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
import { getLocalizedText } from "../../../../../share/locale";
import { Markdown } from "../../../../ui/markdown";
import { interpolateMarkdown } from "../../../utils/resolve";
defineOptions({ name: "ShwfedMarkdownItemRuntime" });
const props = defineProps({
  config: { type: null, required: true }
});
const { locale } = useI18n();
const inherited = injectCELContext();
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
const source = computed(() => {
  const raw = getLocalizedText(props.config.content, locale.value) ?? "";
  return interpolateMarkdown(raw, $cel);
});
</script>

<template>
  <Markdown
    data-slot="buttons-markdown"
    :source="source"
    class="prose prose-sm prose-zinc px-1"
  />
</template>
