el.xwx.moe/components/CollectionCard.tsx

28 lines
1.0 KiB
TypeScript
Raw Normal View History

import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faChevronRight } from "@fortawesome/free-solid-svg-icons";
import { Collection } from "@prisma/client";
2023-03-05 15:03:20 -06:00
import Link from "next/link";
export default function ({ collection }: { collection: Collection }) {
const formattedDate = new Date(collection.createdAt).toLocaleString("en-US", {
year: "numeric",
month: "short",
day: "numeric",
});
return (
2023-03-05 15:03:20 -06:00
<Link href={`/collections/${collection.id}`}>
2023-03-25 09:17:34 -05:00
<div className="p-5 bg-gray-100 h-40 w-60 rounded-md border-sky-100 border-solid border flex flex-col justify-between cursor-pointer hover:bg-gray-50 duration-100">
2023-03-05 15:03:20 -06:00
<div className="flex justify-between text-sky-900 items-center">
<p className="text-lg w-max">{collection.name}</p>
2023-03-28 02:31:50 -05:00
<FontAwesomeIcon
icon={faChevronRight}
className="w-3 h-3 text-gray-500"
/>
2023-03-05 15:03:20 -06:00
</div>
<p className="text-sm text-sky-300 font-bold">{formattedDate}</p>
</div>
2023-03-05 15:03:20 -06:00
</Link>
);
}