Files
test-x6/frontend/src/features/schema/nodes/CardNode.tsx
Alina fd6373bcb0
Some checks failed
continuous-integration/drone/push Build is failing
feat: редизайн UI — приглушённые цвета, шапки устройств, компактные контейнеры
- Цвета статусов: приглушённые тона для печати, красный акцент для неисправных
- DeviceNode: название в цветной шапке, карты ниже без наложений
- Перенос слов вместо обрезки во всех нодах
- Лейаут: убран лишний gap после последнего слоя, SITE_MIN_WIDTH 250,
  корректный расчёт startY от шапки сайта
- Белый фон графа, чёрные линии по умолчанию

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 22:52:26 +03:00

44 lines
1.2 KiB
TypeScript

import type { Node } from '@antv/x6';
import { STATUS_COLORS } from '../../../constants/statusColors.ts';
import type { EntityStatus } from '../../../types/index.ts';
interface CardNodeData {
slotName: string;
networkName: string;
status: EntityStatus;
}
export function CardNode({ node }: { node: Node }) {
const data = node.getData() as CardNodeData;
const colors = STATUS_COLORS[data.status];
const size = node.getSize();
return (
<div
style={{
width: size.width,
height: size.height,
borderTop: `1.5px solid ${colors.border}`,
borderBottom: `1.5px solid ${colors.border}`,
borderLeft: `5px solid ${colors.border}`,
borderRight: `5px solid ${colors.border}`,
borderRadius: 0,
background: colors.fill,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
boxSizing: 'border-box',
fontSize: 9,
fontWeight: 600,
color: colors.text,
textAlign: 'center',
wordBreak: 'break-word',
lineHeight: '12px',
padding: '2px 4px',
}}
>
{data.slotName}:{data.networkName}
</div>
);
}