1- import { useNavigate } from "@tanstack/react-router" ;
1+ import { Link } from "@tanstack/react-router" ;
22import { ChevronLeft , ChevronRight , GitBranch , Play , X } from "lucide-react" ;
33import { useState } from "react" ;
44
@@ -18,23 +18,19 @@ function getFavoriteUrl(item: FavoriteItem): string {
1818}
1919
2020const FavoriteCard = ( { item } : { item : FavoriteItem } ) => {
21- const navigate = useNavigate ( ) ;
2221 const { removeFavorite } = useFavorites ( ) ;
2322
2423 const isPipeline = item . type === "pipeline" ;
2524
2625 return (
27- < div
28- onClick = { ( ) => navigate ( { to : getFavoriteUrl ( item ) } ) }
29- className = { `group relative flex flex-col gap-2 p-3 border rounded-lg cursor-pointer transition-colors ${
30- isPipeline
31- ? "bg-violet-50/40 hover:bg-violet-50 border-violet-100"
32- : "bg-emerald-50/40 hover:bg-emerald-50 border-emerald-100"
33- } `}
26+ < Link
27+ to = { getFavoriteUrl ( item ) }
28+ className = "group relative flex flex-col gap-2.5 p-3 rounded-lg transition-all shadow-sm hover:shadow-md bg-card border border-border hover:border-foreground/20 no-underline"
3429 >
3530 { /* Remove button */ }
3631 < button
3732 onClick = { ( e ) => {
33+ e . preventDefault ( ) ;
3834 e . stopPropagation ( ) ;
3935 removeFavorite ( item . type , item . id ) ;
4036 } }
@@ -44,21 +40,23 @@ const FavoriteCard = ({ item }: { item: FavoriteItem }) => {
4440 < X className = "h-3.5 w-3.5" />
4541 </ button >
4642
47- { /* Type badge */ }
48- < InlineStack gap = "1" blockAlign = "center" >
49- { isPipeline ? (
50- < GitBranch className = "h-3.5 w-3.5 shrink-0 text-violet-500" />
51- ) : (
52- < Play className = "h-3.5 w-3.5 shrink-0 text-emerald-500" />
53- ) }
54- < Text
55- size = "xs"
56- weight = "semibold"
57- className = { isPipeline ? "text-violet-600" : "text-emerald-600" }
43+ { /* Type pill */ }
44+ < div className = "flex" >
45+ < span
46+ className = { `inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs font-semibold ${
47+ isPipeline
48+ ? "bg-violet-100 text-violet-700"
49+ : "bg-emerald-100 text-emerald-700"
50+ } `}
5851 >
52+ { isPipeline ? (
53+ < GitBranch className = "h-3 w-3" />
54+ ) : (
55+ < Play className = "h-3 w-3" />
56+ ) }
5957 { isPipeline ? "Pipeline" : "Run" }
60- </ Text >
61- </ InlineStack >
58+ </ span >
59+ </ div >
6260
6361 { /* Name */ }
6462 < Text size = "sm" weight = "semibold" className = "truncate pr-4 leading-tight" >
@@ -69,7 +67,7 @@ const FavoriteCard = ({ item }: { item: FavoriteItem }) => {
6967 < Text size = "xs" className = "truncate text-muted-foreground font-mono" >
7068 { item . id }
7169 </ Text >
72- </ div >
70+ </ Link >
7371 ) ;
7472} ;
7573
0 commit comments