fix: resolve ESLint errors in Button and Skeleton components
- Button: suppress react-refresh/only-export-components for buttonVariants re-export - Skeleton: replace empty interface with type alias, replace Math.random() with static widths array Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,4 +60,5 @@ export function Button({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line react-refresh/only-export-components
|
||||||
export { buttonVariants }
|
export { buttonVariants }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {}
|
type SkeletonProps = React.HTMLAttributes<HTMLDivElement>
|
||||||
|
|
||||||
export function Skeleton({ className, ...props }: SkeletonProps) {
|
export function Skeleton({ className, ...props }: SkeletonProps) {
|
||||||
return (
|
return (
|
||||||
@@ -27,6 +27,8 @@ export function CardSkeleton({ className }: { className?: string }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const COL_WIDTHS = ['35%', '45%', '25%', '40%', '30%', '50%']
|
||||||
|
|
||||||
export function TableRowSkeleton({ cols = 4 }: { cols?: number }) {
|
export function TableRowSkeleton({ cols = 4 }: { cols?: number }) {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center gap-4 px-4 py-3">
|
<div className="flex items-center gap-4 px-4 py-3">
|
||||||
@@ -34,7 +36,7 @@ export function TableRowSkeleton({ cols = 4 }: { cols?: number }) {
|
|||||||
<Skeleton
|
<Skeleton
|
||||||
key={i}
|
key={i}
|
||||||
className="h-4"
|
className="h-4"
|
||||||
style={{ width: `${20 + Math.random() * 30}%` }}
|
style={{ width: COL_WIDTHS[i % COL_WIDTHS.length] }}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user