Refactor search result display

This commit is contained in:
gpt-engineer-app[bot]
2025-09-30 21:21:05 +00:00
parent 444bc12a5b
commit 496b06fe9e

View File

@@ -275,20 +275,20 @@ export function AutocompleteSearch({
) : ( ) : (
<> <>
<div className="flex-1 min-w-0"> <div className="flex-1 min-w-0">
<div className="flex flex-col sm:flex-row sm:items-center gap-1.5 sm:gap-2"> <div className="flex flex-col gap-1">
<div className="flex items-center gap-1.5 sm:gap-2 min-w-0">
<span className="font-semibold text-foreground text-sm sm:text-base line-clamp-1">{item.title}</span> <span className="font-semibold text-foreground text-sm sm:text-base line-clamp-1">{item.title}</span>
<div className="flex items-center gap-1.5 flex-wrap">
<Badge variant="outline" className={`text-[10px] sm:text-xs font-medium whitespace-nowrap ${getTypeColor(item.type)}`}> <Badge variant="outline" className={`text-[10px] sm:text-xs font-medium whitespace-nowrap ${getTypeColor(item.type)}`}>
{getTypeLabel(item.type)} {getTypeLabel(item.type)}
</Badge> </Badge>
</div>
{item.subtitle && ( {item.subtitle && (
<Badge variant="secondary" className="text-[10px] sm:text-xs whitespace-nowrap w-fit"> <Badge variant="secondary" className="text-[10px] sm:text-xs whitespace-nowrap">
{item.subtitle} {item.subtitle}
</Badge> </Badge>
)} )}
</div> </div>
</div> </div>
</div>
{((item as SearchResult).rating ?? 0) > 0 && ( {((item as SearchResult).rating ?? 0) > 0 && (
<div className="flex items-center gap-1 flex-shrink-0"> <div className="flex items-center gap-1 flex-shrink-0">
<Zap className="w-3 h-3 text-yellow-500" /> <Zap className="w-3 h-3 text-yellow-500" />