<script setup lang="ts">
import { LayoutTemplate } from '@vben/icons';
import { $t } from '@vben/locales';

import BaseNode from './BaseNode.vue';

defineProps(['selected', 'data', 'id']);
</script>

<template>
  <BaseNode
    :selected="selected"
    :execution-status="data.executionStatus"
    :execution-result="data.executionResult"
    :label="data.label || $t('ai-platform.workflow.nodes.template.label')"
    :inputs="[{ id: 'target' }]"
    :outputs="[{ id: 'source' }]"
    :node-id="id"
    node-type="template"
  >
    <template #icon><LayoutTemplate class="size-5" /></template>
    <template #desc>
      {{ $t('ai-platform.workflow.nodes.template.desc') }}
    </template>

    <div
      class="bg-muted text-muted-foreground line-clamp-3 break-all rounded p-2 font-mono text-xs"
      v-text="data.template || '{{ input }}'"
    ></div>
  </BaseNode>
</template>
