|
28 | 28 | } |
29 | 29 | } |
30 | 30 |
|
31 | | - function getScoreColor(score: number): string { |
32 | | - if (score >= 8) return 'bg-green-500'; |
33 | | - if (score >= 6) return 'bg-yellow-500'; |
34 | | - return 'bg-red-500'; |
35 | | - } |
36 | | -
|
37 | 31 | function getScoreVariant(score: number): 'default' | 'secondary' | 'destructive' | 'outline' { |
38 | 32 | if (score >= 8) return 'default'; |
39 | 33 | if (score >= 6) return 'secondary'; |
|
84 | 78 | <div> |
85 | 79 | <h4 class="mb-2 text-sm font-semibold text-green-600 dark:text-green-500">Pros</h4> |
86 | 80 | <ul class="space-y-1 text-sm"> |
87 | | - {#each entry.assessment.pros.slice(0, 3) as pro} |
| 81 | + {#each entry.assessment.pros.slice(0, 3) as pro, i (i)} |
88 | 82 | <li class="text-muted-foreground">• {pro}</li> |
89 | 83 | {/each} |
90 | 84 | {#if entry.assessment.pros.length > 3} |
|
100 | 94 | <div> |
101 | 95 | <h4 class="mb-2 text-sm font-semibold text-red-600 dark:text-red-500">Cons</h4> |
102 | 96 | <ul class="space-y-1 text-sm"> |
103 | | - {#each entry.assessment.cons.slice(0, 3) as con} |
| 97 | + {#each entry.assessment.cons.slice(0, 3) as con, i (i)} |
104 | 98 | <li class="text-muted-foreground">• {con}</li> |
105 | 99 | {/each} |
106 | 100 | {#if entry.assessment.cons.length > 3} |
|
117 | 111 | <div class="mt-4 border-t pt-4"> |
118 | 112 | <h4 class="mb-2 text-xs font-semibold text-muted-foreground">Key Ingredients</h4> |
119 | 113 | <div class="flex flex-wrap gap-1"> |
120 | | - {#each entry.product.ingredients.slice(0, 5) as ingredient} |
| 114 | + {#each entry.product.ingredients.slice(0, 5) as ingredient, i (i)} |
121 | 115 | <Badge variant="outline" class="text-xs">{ingredient}</Badge> |
122 | 116 | {/each} |
123 | 117 | {#if entry.product.ingredients.length > 5} |
|
0 commit comments