Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/modules/scores/score-stats.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { Check, Clock, Hash, Info, Star, Target, X } from 'lucide-react';
import { Check, Clock, Info, Star, Target, X } from 'lucide-react';
import { useTranslations } from 'use-intl';

import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
Expand Down Expand Up @@ -93,7 +93,7 @@ export function ScoreStats({
<div className="flex items-center gap-2">
<Tooltip>
<TooltipTrigger asChild>
<Stat icon={Hash} className="cursor-default">
<Stat className="cursor-default">
<span className="inline-flex items-baseline gap-1.5">
{formatNumber(score.modifiedScore)}
{score.mods.length > 0 && <span className="text-muted-foreground text-[10px] font-semibold">{score.mods.join(', ')}</span>}
Expand Down
4 changes: 2 additions & 2 deletions src/shared/components/stat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { IconType } from 'react-icons';
import { cn } from '@/shared/format/helpers';

interface StatProps extends React.HTMLAttributes<HTMLDivElement> {
icon: IconType | React.ComponentType<{ className?: string }>;
icon?: IconType | React.ComponentType<{ className?: string }>;
label?: string;
children: React.ReactNode;
labelClassName?: string;
Expand All @@ -21,7 +21,7 @@ export const Stat = forwardRef<HTMLDivElement, StatProps>(
className={cn('bg-secondary/35 text-muted-foreground inline-flex items-center gap-2 rounded-md border px-2.5 py-1 text-xs', className)}
{...props}
>
<Icon className={cn('h-3 w-3 shrink-0', iconClassName)} />
{Icon ? <Icon className={cn('h-3 w-3 shrink-0', iconClassName)} /> : null}
{label ? <span className={cn('cursor-default select-none', labelClassName)}>{label}</span> : null}
<span className={cn('text-foreground font-semibold', valueClassName)}>{children}</span>
</div>
Expand Down