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

import BaseNode from './BaseNode.vue';

defineProps<{
  data: any;
  id: string;
  selected: boolean;
}>();
</script>

<template>
  <BaseNode
    :selected="selected"
    :execution-status="data.executionStatus"
    :execution-result="data.executionResult"
    :label="
      data.label || $t('ai-platform.workflow.nodes.dashboard_basic_info.label')
    "
    :inputs="[{ id: 'target' }]"
    :outputs="[{ id: 'source' }]"
    :node-id="id"
    node-type="dashboard_basic_info"
  >
    <template #icon><FileText class="size-5" /></template>
    <template #desc>
      {{ $t('ai-platform.workflow.nodes.dashboard_basic_info.desc') }}
    </template>
    <div class="space-y-1 text-xs">
      <div v-if="data.name" class="text-muted-foreground truncate">
        <span class="font-medium">{{
          $t('ai-platform.workflow.nodes.dashboard_basic_info.name')
        }}</span>
        {{ data.name }}
      </div>
      <div v-if="data.code" class="text-muted-foreground truncate">
        <span class="font-medium">{{
          $t('ai-platform.workflow.nodes.dashboard_basic_info.code')
        }}</span>
        {{ data.code }}
      </div>
      <div v-if="data.category" class="text-muted-foreground truncate">
        <span class="font-medium">{{
          $t('ai-platform.workflow.nodes.dashboard_basic_info.category')
        }}</span>
        {{ data.category }}
      </div>
    </div>
    <template #footer>
      <div class="text-muted-foreground truncate text-[10px]">
        {{ $t('ai-platform.workflow.nodes.common.output') }}
        dashboard_basic_info
      </div>
    </template>
  </BaseNode>
</template>
