'use client'

import type { BacklogProgress } from '../types'

interface OverallProgressProps {
  progress: BacklogProgress
  onReset: () => void
}

export function OverallProgress({ progress, onReset }: OverallProgressProps) {
  return (
    <div className="bg-white rounded-xl border border-slate-200 p-6">
      <div className="flex items-center justify-between mb-4">
        <div>
          <h2 className="text-lg font-semibold text-slate-900">Gesamtfortschritt</h2>
          <p className="text-sm text-slate-500">
            {progress.completed} von {progress.total} Aufgaben abgeschlossen
          </p>
        </div>
        <div className="flex items-center gap-4">
          <button
            onClick={onReset}
            className="text-sm text-slate-500 hover:text-slate-700"
          >
            Zuruecksetzen
          </button>
          <div className="text-3xl font-bold text-blue-600">{progress.percentage}%</div>
        </div>
      </div>
      <div className="w-full bg-slate-200 rounded-full h-3">
        <div
          className="bg-blue-600 h-3 rounded-full transition-all duration-500"
          style={{ width: `${progress.percentage}%` }}
        />
      </div>
    </div>
  )
}
