Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import clsx from "~/utils/shared/ClassesUtils";
|
||||
import { StarIcon } from "~/components/ui/icons/vendor";
|
||||
|
||||
export default function RatingBadge({ value, size = 4, starsCount = 5 }: { value: number; size?: number; starsCount?: number }) {
|
||||
return (
|
||||
<div>
|
||||
<div className="flex items-center">
|
||||
{Array.from({ length: starsCount }).map((_, index) => (
|
||||
<Star key={index} size={size} color={index < value ? "yellow" : "gray"} />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function Star({ color, size = 5 }: { color: "gray" | "yellow"; size?: number }) {
|
||||
return (
|
||||
<StarIcon
|
||||
aria-hidden="true"
|
||||
className={clsx(
|
||||
size === 2 && "h-2 w-2",
|
||||
size === 3 && "h-3 w-3",
|
||||
size === 4 && "h-4 w-4",
|
||||
size === 5 && "h-5 w-5",
|
||||
size === 6 && "h-6 w-6",
|
||||
size === 7 && "h-7 w-7",
|
||||
color === "gray" ? "text-gray-300" : "text-yellow-400"
|
||||
)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user