创建评查点分组的API文件

This commit is contained in:
2025-04-07 00:46:31 +08:00
parent 145aec6aa6
commit 17f330d07d
9 changed files with 1310 additions and 638 deletions
+5 -2
View File
@@ -8,6 +8,7 @@ interface StatusDotProps {
className?: string;
size?: 'default' | 'sm' | 'lg';
pulse?: boolean;
align?: 'left' | 'center' | 'right';
}
export function StatusDot({
@@ -15,7 +16,8 @@ export function StatusDot({
text,
className = '',
size = 'default',
pulse = false
pulse = false,
align = 'left'
}: StatusDotProps) {
// 如果status是布尔值,则转换为对应的状态类型
const statusType = typeof status === 'boolean'
@@ -32,9 +34,10 @@ export function StatusDot({
const sizeClass = size !== 'default' ? `status-dot-${size}` : '';
const pulseClass = pulse ? 'status-dot-pulse' : '';
const alignClass = align === 'center' ? 'justify-center' : align === 'right' ? 'justify-end' : 'justify-start';
return (
<span className={`status-dot-with-text ${className}`}>
<span className={`status-dot-with-text ${alignClass} ${className}`}>
<span className={`status-dot status-dot-${statusType} ${sizeClass} ${pulseClass}`}></span>
<span className="status-dot-text">{statusText}</span>
</span>