main
|
Last change
on this file was 700e2f9, checked in by 186079 <matej.milevski@…>, 5 days ago |
|
Init
|
-
Property mode
set to
100644
|
|
File size:
927 bytes
|
| Line | |
|---|
| 1 | import type { Component } from "solid-js";
|
|---|
| 2 |
|
|---|
| 3 | const ratings = [
|
|---|
| 4 | { color: "red", range: "1-2", label: "Very Bad" },
|
|---|
| 5 | { color: "orange", range: "3-4", label: "Bad" },
|
|---|
| 6 | { color: "yellow", range: "5-6", label: "Okay" },
|
|---|
| 7 | { color: "green", range: "7-8", label: "Good" },
|
|---|
| 8 | { color: "blue", range: "9-10", label: "Excellent" },
|
|---|
| 9 | ];
|
|---|
| 10 |
|
|---|
| 11 | const RatingLegend: Component = () => (
|
|---|
| 12 | <div class="mt-6 pt-6 border-t border-gray-200">
|
|---|
| 13 | <h3 class="text-sm font-semibold text-gray-700 mb-3">Rating Legend:</h3>
|
|---|
| 14 | <div class="flex flex-wrap gap-4">
|
|---|
| 15 | {ratings.map((rating) => (
|
|---|
| 16 | <div class="flex items-center gap-2">
|
|---|
| 17 | <div
|
|---|
| 18 | class={`w-4 h-4 bg-${rating.color}-200 border-2 border-${rating.color}-300 rounded`}
|
|---|
| 19 | />
|
|---|
| 20 | <span class="text-xs text-gray-600">
|
|---|
| 21 | {rating.range} ({rating.label})
|
|---|
| 22 | </span>
|
|---|
| 23 | </div>
|
|---|
| 24 | ))}
|
|---|
| 25 | </div>
|
|---|
| 26 | </div>
|
|---|
| 27 | );
|
|---|
| 28 |
|
|---|
| 29 | export default RatingLegend;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.