"use client"
import { type Color, type Image, type ImageColor } from "@/generated/prisma"
import { useGlobalSettings } from "@/hooks/useGlobalSettings"
import clsx from "clsx"
import { BookOpenIcon, EyeOffIcon, ImagePlusIcon } from "lucide-react"
import NextImage from "next/image"
import Link from "next/link"
import { GlowingBorderWrapper } from "./GlowingBorderWrapper"
import { TagBadge } from "./TagBadge"
type CoverCardProps = {
item: {
id: string
name: string
slug: string
coverImage?: (Image & {
colors?: (ImageColor & { color: Color })[]
}) | null
type: "album" | "gallery"
gallerySlug?: string
}
}
export default function CoverCard({ item }: CoverCardProps) {
const { showNSFW, animateGlow } = useGlobalSettings()
const { coverImage } = item
const href =
item.type === "album"
? `/galleries/${item.gallerySlug}/${item.slug}`
: `/galleries/${item.slug}`
const badgeText = item.type === "album" ? "Album" : "Gallery"
const badgeIcon =
item.type === "album" ?