'use client'
// src/components/analyses/AnalysisHeader.tsx
// Input: project: Project
// Output: compact info row — last analysis date, duration, model version, rerun button
// Rationale: persistent context strip above tabs, factual at-a-glance info

import { RefreshCw, Clock, Cpu, Calendar } from 'lucide-react'
import { Button } from '@/components/ui/Button'
import { formatDate } from '@/lib/utils'
import type { Project } from '@/types'

interface AnalysisHeaderProps {
  project: Project
}

export function AnalysisHeader({ project }: AnalysisHeaderProps) {
  return (
    <div className="flex items-center gap-6 px-4 py-2.5 bg-bg-elevated border border-bg-border rounded-lg mb-4">
      <span className="flex items-center gap-1.5 text-caption text-text-secondary">
        <Calendar size={13} strokeWidth={1.5} className="text-text-muted" />
        Dernière analyse :&nbsp;
        <span className="text-text-primary font-mono-small">
          {formatDate(project.lastMeasurementAt)}
        </span>
      </span>
      <span className="flex items-center gap-1.5 text-caption text-text-secondary">
        <Clock size={13} strokeWidth={1.5} className="text-text-muted" />
        Durée :&nbsp;
        <span className="text-text-primary font-mono-small">42s</span>
      </span>
      <span className="flex items-center gap-1.5 text-caption text-text-secondary">
        <Cpu size={13} strokeWidth={1.5} className="text-text-muted" />
        Modèle :&nbsp;
        <span className="text-text-primary font-mono-small">FFT v2.1.3</span>
      </span>
      <div className="ml-auto">
        <Button variant="ghost" size="sm" iconLeft={<RefreshCw size={13} strokeWidth={1.5} />}>
          Relancer
        </Button>
      </div>
    </div>
  )
}
