This commit is contained in:
2025-12-01 17:21:38 +08:00
parent 32fee2b8ab
commit fab8c13cb3
7511 changed files with 996300 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
import type { ComponentProps, FC } from 'react'
import classNames from '@/utils/classnames'
type SkeletonProps = ComponentProps<'div'>
export const SkeletonContainer: FC<SkeletonProps> = (props) => {
const { className, children, ...rest } = props
return (
<div className={classNames('flex flex-col gap-1', className)} {...rest}>
{children}
</div>
)
}
export const SkeletonRow: FC<SkeletonProps> = (props) => {
const { className, children, ...rest } = props
return (
<div className={classNames('flex items-center gap-2', className)} {...rest}>
{children}
</div>
)
}
export const SkeletonRectangle: FC<SkeletonProps> = (props) => {
const { className, children, ...rest } = props
return (
<div className={classNames('my-1 h-2 rounded-sm bg-text-quaternary opacity-20', className)} {...rest}>
{children}
</div>
)
}
export const SkeletonPoint: FC<SkeletonProps> = (props) => {
const { className, ...rest } = props
return (
<div className={classNames('text-xs font-medium text-text-quaternary', className)} {...rest}>·</div>
)
}
/** Usage
* <SkeletonContainer>
* <SkeletonRow>
* <SkeletonRectangle className="w-96" />
* <SkeletonPoint />
* <SkeletonRectangle className="w-96" />
* </SkeletonRow>
* <SkeletonRow>
* <SkeletonRectangle className="w-96" />
* </SkeletonRow>
* <SkeletonRow>
*/