mirror of
https://github.com/yusufipk/RepoHub.git
synced 2026-09-11 18:46:07 +00:00
Remove recommendation score and reason from UI and simplify logic
This commit is contained in:
@@ -41,32 +41,7 @@ export function RecommendationCard({ pkg, isSelected, onToggle }: Recommendation
|
||||
{pkg.description}
|
||||
</p>
|
||||
|
||||
{/* Recommendation score and reason */}
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-xs text-muted-foreground">
|
||||
{t('recommendations.score')}
|
||||
</span>
|
||||
<div className="flex items-center gap-1">
|
||||
<div className="h-2 w-16 bg-secondary rounded-full overflow-hidden">
|
||||
<div
|
||||
className="h-full bg-primary rounded-full transition-all"
|
||||
style={{ width: `${pkg.recommendationScore}%` }}
|
||||
/>
|
||||
</div>
|
||||
<span className="text-xs font-semibold">{pkg.recommendationScore}%</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{pkg.recommendationReason && (
|
||||
<div className="pt-2 border-t">
|
||||
<p className="text-xs text-muted-foreground">
|
||||
<span className="font-semibold">{t('recommendations.reason')}</span>{' '}
|
||||
{pkg.recommendationReason}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<Button
|
||||
variant={isSelected ? 'default' : 'outline'}
|
||||
|
||||
@@ -12,8 +12,8 @@ export function RecommendationListItem({ pkg, isSelected, onToggle }: Recommenda
|
||||
return (
|
||||
<div
|
||||
className={`flex items-center gap-3 p-3 rounded-lg border-2 transition-all cursor-pointer hover:shadow-md ${isSelected
|
||||
? 'border-primary bg-primary/5'
|
||||
: 'border-border hover:border-primary/50'
|
||||
? 'border-primary bg-primary/5'
|
||||
: 'border-border hover:border-primary/50'
|
||||
}`}
|
||||
onClick={() => onToggle(pkg)}
|
||||
>
|
||||
@@ -35,39 +35,21 @@ export function RecommendationListItem({ pkg, isSelected, onToggle }: Recommenda
|
||||
<p className="text-xs text-muted-foreground truncate">{pkg.description}</p>
|
||||
</div>
|
||||
|
||||
{/* Score Badge */}
|
||||
<div className="flex items-center gap-2 flex-shrink-0">
|
||||
<div className="text-right">
|
||||
<div className="text-xs font-semibold text-primary">
|
||||
{pkg.recommendationScore}%
|
||||
</div>
|
||||
<div className="text-xs text-muted-foreground">match</div>
|
||||
</div>
|
||||
|
||||
{/* Info Tooltip */}
|
||||
{pkg.recommendationReason && (
|
||||
<div className="relative group">
|
||||
<Info className="h-4 w-4 text-muted-foreground cursor-help" />
|
||||
<div className="absolute right-0 top-full mt-2 w-64 p-2 bg-popover text-popover-foreground text-xs rounded-md shadow-lg border opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10">
|
||||
<p className="font-semibold mb-1">Why recommended?</p>
|
||||
<p>{pkg.recommendationReason}</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Select Button */}
|
||||
<Button
|
||||
variant={isSelected ? 'default' : 'outline'}
|
||||
size="sm"
|
||||
className="ml-2"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
onToggle(pkg)
|
||||
}}
|
||||
>
|
||||
{isSelected ? '✓' : '+'}
|
||||
</Button>
|
||||
</div>
|
||||
{/* Select Button */}
|
||||
<Button
|
||||
variant={isSelected ? 'default' : 'outline'}
|
||||
size="sm"
|
||||
className="ml-2"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
onToggle(pkg)
|
||||
}}
|
||||
>
|
||||
{isSelected ? '✓' : '+'}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user