Skip to content

Commit edbef90

Browse files
committed
fix(usage-slider): rtl optimize ui
1 parent 41b2cb9 commit edbef90

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dashboard/src/components/users/usage-slider-compact.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { cn } from '@/lib/utils'
33
import { formatBytes } from '@/utils/formatByte'
44
import { useTranslation } from 'react-i18next'
55
import { Progress } from '@/components/ui/progress'
6+
import useDirDetection from '@/hooks/use-dir-detection'
67

78
type UsageSliderProps = {
89
used: number
@@ -17,8 +18,9 @@ const UsageSliderCompact: React.FC<UsageSliderProps> = ({ used, total = 0, statu
1718
const progressValue = isUnlimited ? 100 : (used / total) * 100
1819
const color = statusColors[status]?.sliderColor
1920
const { t } = useTranslation()
21+
const isRTL = useDirDetection() === 'rtl'
2022
return (
21-
<div className="flex w-full flex-col justify-between gap-y-1 text-xs font-medium text-muted-foreground text-left">
23+
<div className={cn("flex w-full flex-col justify-between gap-y-1 text-xs font-medium text-muted-foreground text-left", isRTL ? "md:text-end" : "md:text-start")}>
2224
<Progress indicatorClassName={color} value={progressValue} className={cn(isMobile ? 'block' : 'hidden md:block')} />
2325
<div className="flex items-center justify-between w-full">
2426
<span className={isMobile ? 'hidden' : 'w-full'} dir="ltr">

0 commit comments

Comments
 (0)