<script setup lang="ts">
import { Play } 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="$t('ai-platform.workflow.nodes.start.label')"
    :outputs="[{ id: 'source' }]"
    :node-id="id"
    node-type="start"
  >
    <template #icon><Play class="size-5" /></template>
    <template #desc>{{ $t('ai-platform.workflow.nodes.start.desc') }}</template>

    <div class="bg-muted text-muted-foreground rounded p-2 text-xs">
      <div v-if="data.variables && data.variables.length > 0">
        {{
          $t('ai-platform.workflow.nodes.common.inputVariablesCount', {
            count: data.variables.length,
          })
        }}
      </div>
      <div v-else>
        {{ $t('ai-platform.workflow.nodes.common.noInputVariables') }}
      </div>
    </div>
  </BaseNode>
</template>
