import { Link } from 'react-router-dom'
import type { Guide } from '@/data/guides'

interface GuideCardProps {
  guide: Guide
}

export function GuideCard({ guide }: GuideCardProps) {
  const Icon = guide.icon

  return (
    <Link
      to={`/guides/${guide.slug}`}
      className="card-interactive block rounded-lg p-5 transition-all"
    >
      <div className="flex items-start gap-3.5">
        <div className="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-primary/10">
          <Icon size={20} className="text-primary" />
        </div>
        <div className="min-w-0">
          <h3 className="text-sm font-heading font-semibold text-foreground mb-1">
            {guide.title}
          </h3>
          <p className="text-xs text-muted-foreground leading-relaxed">
            {guide.summary}
          </p>
          <span className="mt-2 inline-block font-sans text-[0.625rem] uppercase tracking-widest text-primary">
            {guide.sections.length} {guide.sections.length === 1 ? 'section' : 'sections'}
          </span>
        </div>
      </div>
    </Link>
  )
}
