"use client";

import Link from "next/link";
import { Tags } from "lucide-react";
import { FollowButton } from "@/components/shared/FollowButton";
import { TOPICS } from "@/lib/topics";

export default function TopicsPage() {
  return (
    <div className="space-y-6">
      <div>
        <h1 className="text-2xl font-bold">Topics</h1>
        <p className="text-muted-foreground text-sm mt-1">
          Follow topics to see related bills in your feed
        </p>
      </div>

      <div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
        {TOPICS.map(({ tag, label, desc }) => (
          <div key={tag} className="bg-card border border-border rounded-lg p-4 flex items-start justify-between gap-3">
            <div>
              <div className="flex items-center gap-2 mb-1">
                <Tags className="w-3.5 h-3.5 text-muted-foreground" />
                <Link
                  href={`/bills?topic=${tag}`}
                  className="font-medium text-sm hover:text-primary transition-colors"
                >
                  {label}
                </Link>
              </div>
              <p className="text-xs text-muted-foreground">{desc}</p>
            </div>
            <FollowButton type="topic" value={tag} />
          </div>
        ))}
      </div>
    </div>
  );
}
