mirror of
https://github.com/langgenius/dify.git
synced 2026-01-08 07:14:14 +00:00
# Conflicts: # web/app/components/workflow/block-icon.tsx # web/app/components/workflow/hooks/use-nodes-interactions.ts # web/app/components/workflow/index.tsx # web/app/components/workflow/nodes/components.ts # web/app/components/workflow/selection-contextmenu.tsx # web/app/components/workflow/utils/workflow-init.ts
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
import type { ComponentProps, FC } from 'react'
|
|
import { cn } from '@/utils/classnames'
|
|
|
|
type SkeletonProps = ComponentProps<'div'>
|
|
|
|
export const SkeletonContainer: FC<SkeletonProps> = (props) => {
|
|
const { className, children, ...rest } = props
|
|
return (
|
|
<div className={cn('flex flex-col gap-1', className)} {...rest}>
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export const SkeletonRow: FC<SkeletonProps> = (props) => {
|
|
const { className, children, ...rest } = props
|
|
return (
|
|
<div className={cn('flex items-center gap-2', className)} {...rest}>
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export const SkeletonRectangle: FC<SkeletonProps> = (props) => {
|
|
const { className, children, ...rest } = props
|
|
return (
|
|
<div className={cn('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={cn('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>
|
|
*/
|