admin/components/heroui/Progress.tsx
alisaza e1eaf5eff5 feat: initial ghabilee-admin backoffice app
Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js
app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
2026-09-05 13:12:59 +03:30

32 lines
907 B
TypeScript

'use client'
import type { ComponentProps } from 'react'
import { ProgressBar } from '@heroui/react'
type ProgressProps = Omit<ComponentProps<typeof ProgressBar>, 'color' | 'children' | 'className'> & {
color?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger'
className?: string
classNames?: {
base?: string
track?: string
indicator?: string
}
}
export function Progress({ className, classNames, color = 'primary', ...props }: ProgressProps) {
const mappedColor = color === 'primary' ? 'accent' : color === 'secondary' ? 'accent' : color
return (
<ProgressBar
className={`${classNames?.base ?? ''} ${className ?? ''}`.trim()}
color={mappedColor}
{...props}
>
<ProgressBar.Track className={classNames?.track}>
<ProgressBar.Fill className={classNames?.indicator} />
</ProgressBar.Track>
</ProgressBar>
)
}