11import { Info , Newspaper , Users } from "lucide-react" ;
22import { Badge } from "../../ui/badge" ;
33import { cn } from "../../../lib/utils" ;
4+ import { Link } from "@tanstack/react-router" ;
45
56interface CardProps {
7+ id : string ;
68 image : string ;
79 title : string ;
810 tags : string [ ] ;
@@ -14,6 +16,7 @@ interface CardProps {
1416}
1517
1618export function Card ( {
19+ id,
1720 image,
1821 title,
1922 tags,
@@ -24,58 +27,63 @@ export function Card({
2427 isCompleted,
2528} : CardProps ) {
2629 return (
27- < div className = "self-stretch flex flex-col" >
28- { ! isCompleted && (
29- < div className = "flex items-center text-yellow-700 gap-4 px-4 py-2 rounded-t-lg border border-yellow-700 bg-yellow-50" >
30- < Info strokeWidth = { 1.5 } size = { 24 } />
31- Setup incomplete
32- </ div >
33- ) }
34- < div
35- className = { cn (
36- "flex p-4 gap-[32px] flex-col justify-between flex-1 self-stretch rounded-lg border border-neutral-200 bg-white" ,
37- ! isCompleted && "border-yellow-700 rounded-t-none border-t-0" ,
30+ < Link to = { "/feed/$feedId" } params = { { feedId : id } } className = "no-underline" >
31+ < div className = "self-stretch flex flex-col" >
32+ { ! isCompleted && (
33+ < div className = "flex items-center text-yellow-700 gap-4 px-4 py-2 rounded-t-lg border border-yellow-700 bg-yellow-50" >
34+ < Info strokeWidth = { 1.5 } size = { 24 } />
35+ Setup incomplete
36+ </ div >
3837 ) }
39- >
40- < div className = "space-y-3" >
41- < div className = "flex gap-[14px] p-2.5 rounded-md bg-neutral-50" >
42- < img
43- src = { image }
44- alt = "Near Week"
45- className = "object-cover size-[68px] shrink-0"
46- />
47- < div >
48- < p className = "font-londrina font-[900] text-black text-[24px]" >
49- { title }
50- </ p >
51- < div className = "flex items-center gap-2 flex-wrap" >
52- { tags . length > 0 &&
53- tags . map ( ( tag , index ) => (
54- < Badge key = { index } className = "text-xs" >
55- #{ tag }
56- </ Badge >
57- ) ) }
38+ < div
39+ className = { cn (
40+ "flex p-4 gap-[32px] flex-col justify-between flex-1 self-stretch rounded-lg border border-neutral-200 bg-white" ,
41+ ! isCompleted && "border-yellow-700 rounded-t-none border-t-0" ,
42+ ) }
43+ >
44+ < div className = "space-y-3" >
45+ < div className = "flex gap-[14px] p-2.5 rounded-md bg-neutral-50" >
46+ < img
47+ src = { image }
48+ alt = { title }
49+ className = "object-cover size-[68px] shrink-0"
50+ onError = { ( e ) => {
51+ e . currentTarget . src = "/images/default-feed.png" ;
52+ } }
53+ />
54+ < div >
55+ < p className = "font-londrina font-[900] text-black text-[24px]" >
56+ { title }
57+ </ p >
58+ < div className = "flex items-center gap-2 flex-wrap" >
59+ { tags . length > 0 &&
60+ tags . map ( ( tag , index ) => (
61+ < Badge key = { index } className = "text-xs" >
62+ #{ tag }
63+ </ Badge >
64+ ) ) }
65+ </ div >
5866 </ div >
5967 </ div >
68+ < p > { description } </ p >
69+ < p className = "mt-0.5" > Created { createdAt . toLocaleDateString ( ) } </ p >
6070 </ div >
61- < p > { description } </ p >
62- < p className = "mt-0.5" > Created { createdAt . toLocaleDateString ( ) } </ p >
63- </ div >
64- < div className = "flex gap-[14px] items-center justify-between p-2.5 rounded-md bg-neutral-50" >
65- < div className = "flex items-center gap-2" >
66- < Users strokeWidth = { 1.5 } size = { 24 } />
67- < p className = "text-black text-base" >
68- < span className = "font-bold" > { curators } </ span > Curators
69- </ p >
70- </ div >
71- < div className = "flex items-center gap-2" >
72- < Newspaper strokeWidth = { 1.5 } size = { 24 } />
73- < p className = "text-black text-base" >
74- < span className = "font-bold" > { contents } </ span > Contents
75- </ p >
71+ < div className = "flex gap-[14px] items-center justify-between p-2.5 rounded-md bg-neutral-50" >
72+ < div className = "flex items-center gap-2" >
73+ < Users strokeWidth = { 1.5 } size = { 24 } />
74+ < p className = "text-black text-base" >
75+ < span className = "font-bold" > { curators } </ span > Curators
76+ </ p >
77+ </ div >
78+ < div className = "flex items-center gap-2" >
79+ < Newspaper strokeWidth = { 1.5 } size = { 24 } />
80+ < p className = "text-black text-base" >
81+ < span className = "font-bold" > { contents } </ span > Contents
82+ </ p >
83+ </ div >
7684 </ div >
7785 </ div >
7886 </ div >
79- </ div >
87+ </ Link >
8088 ) ;
8189}
0 commit comments