<!-- #region ValidationTaskReport [C:2] [TYPE Component] [SEMANTICS llm, validation, report] -->
<!-- @ingroup LLM -->
<!-- @BRIEF Simple validation report display component — shows status badge and summary text. -->
<script lang="ts">
  import { t } from "$lib/i18n/index.svelte.js";

  interface ValidationReport {
    status: string;
    summary?: string;
    issues?: Array<{ severity: string; message: string; location?: string }>;
  }

  let { result }: { result: ValidationReport | null } = $props();

  function getStatusColor(status: string): string {
    switch (status) {
      case 'PASS': return 'text-success bg-success-light';
      case 'WARN': return 'text-warning bg-warning-light';
      case 'FAIL': return 'text-destructive bg-destructive-light';
      default: return 'text-text-muted bg-surface-muted';
    }
  }
</script>

<div class="bg-surface-card shadow rounded-lg p-6 space-y-6">
  {#if result}
    <div class="flex items-center justify-between">
      <h2 class="text-xl font-bold text-text">{$t.validation?.report_title || "Validation Report"}</h2>
      <span class={`px-3 py-1 rounded-full text-sm font-medium ${getStatusColor(result.status)}`}>
        {result.status}
      </span>
    </div>
    {#if result.summary}
      <p class="text-text">{result.summary}</p>
    {/if}
  {:else}
    <p class="text-text-muted">{$t.validation?.no_report || "No report data"}</p>
  {/if}
</div>
<!-- #endregion ValidationTaskReport -->
