Refactor search result layout

This commit is contained in:
gpt-engineer-app[bot]
2025-09-29 14:50:19 +00:00
parent 2907319e45
commit 7581ba053b

View File

@@ -274,16 +274,18 @@ export function AutocompleteSearch({
) : ( ) : (
<> <>
<div className="flex-1 min-w-0"> <div className="flex-1 min-w-0">
<div className="flex items-center gap-2 mb-1"> <div className="flex items-center justify-between gap-2">
<div className="flex items-center gap-2 min-w-0">
<span className="font-semibold text-foreground truncate">{item.title}</span> <span className="font-semibold text-foreground truncate">{item.title}</span>
<Badge variant="outline" className={`text-xs font-medium ${getTypeColor(item.type)}`}> <Badge variant="outline" className={`text-xs font-medium ${getTypeColor(item.type)}`}>
{getTypeLabel(item.type)} {getTypeLabel(item.type)}
</Badge> </Badge>
</div> </div>
<div className="text-sm text-muted-foreground/80 truncate mt-0.5 leading-relaxed"> <div className="text-sm text-muted-foreground/80 truncate leading-relaxed flex-shrink-0">
{item.subtitle} {item.subtitle}
</div> </div>
</div> </div>
</div>
{(item as SearchResult).rating && (item as SearchResult).rating! > 0 && ( {(item as SearchResult).rating && (item as SearchResult).rating! > 0 && (
<div className="flex items-center gap-1 ml-3"> <div className="flex items-center gap-1 ml-3">
<Zap className="w-3 h-3 text-yellow-500" /> <Zap className="w-3 h-3 text-yellow-500" />