feat: optimize navigation

This commit is contained in:
2023-07-30 21:43:09 +02:00
parent 0632ae05c1
commit 28c72264c5
15 changed files with 170 additions and 27 deletions

View File

@@ -4,13 +4,14 @@ import IconStarFilled from "https://deno.land/x/tabler_icons_tsx@0.0.3/tsx/star-
export const Star = (
{ max = 5, rating = 3 }: { max?: number; rating: number },
) => {
console.log({ max, rating });
return (
<div
class="flex gap-2 px-4 py-2 rounded-2xl bg-gray-200 z-10"
style={{ color: "#1F1F1F" }}
>
{Array.from({ length: max }).map((_, i) => {
if (rating >= i) {
if ((i + 1) <= rating) {
return <IconStarFilled class="w-4 h-4" />;
}
return <IconStar class="w-4 h-4" />;