import Link from "next/link";

import type { ProjectResponse } from "@/lib/api/types";

interface ProjectCardProps {
  project: ProjectResponse;
}

// 作品卡（UX §6.1）：书名衬线大字、题材、一句话故事。
// M1 无字数/章数/待办统计端点 → 暂不展示该徽标（避免编造 API）。
export function ProjectCard({ project }: ProjectCardProps) {
  return (
    <Link
      href={`/projects/${project.id}/write`}
      className="flex h-full min-h-[160px] flex-col rounded border border-line bg-panel p-6 shadow-paper hover:border-cinnabar"
    >
      <h2 className="font-serif text-2xl text-ink">〈{project.title}〉</h2>
      {project.genre ? (
        <p className="mt-2 text-sm text-ink-soft">{project.genre}</p>
      ) : null}
      {project.logline ? (
        <p className="mt-3 line-clamp-3 text-sm text-ink">{project.logline}</p>
      ) : null}
    </Link>
  );
}
