import PurchaseButton from "@/components/purchase-button";
import { formatPrice } from "@/lib/format";

type GradeCardProps = {
  grade: {
    id: string;
    name: string;
    price: number;
    description: string;
  };
};

export default function GradeCard({ grade }: GradeCardProps) {
  return (
    <div className="flex h-full flex-col justify-between rounded-3xl border border-white/10 bg-white/5 p-6 backdrop-blur">
      <div>
        <p className="text-xs uppercase tracking-[0.3em] text-cyan-200/80">
          {grade.name}
        </p>
        <p className="mt-4 text-3xl font-semibold text-white">
          {formatPrice(grade.price)}
        </p>
        <p className="mt-3 text-sm text-slate-300">{grade.description}</p>
      </div>
      <div className="mt-6 flex items-center justify-between">
        <span className="text-[10px] uppercase tracking-[0.3em] text-slate-400">
          Instant access
        </span>
        <PurchaseButton gradeId={grade.id} />
      </div>
    </div>
  );
}
