2026-01-14 20:00:35 -05:00
|
|
|
import { memo } from 'react';
|
|
|
|
|
import { NodeProps } from 'reactflow';
|
|
|
|
|
import { BaseNode } from './BaseNode';
|
|
|
|
|
import { ConstraintNodeData } from '../../../lib/canvas/schema';
|
|
|
|
|
|
|
|
|
|
function ConstraintNodeComponent(props: NodeProps<ConstraintNodeData>) {
|
|
|
|
|
const { data } = props;
|
|
|
|
|
return (
|
2026-01-14 20:30:28 -05:00
|
|
|
<BaseNode {...props} icon={<span>🚧</span>} color="text-orange-600" colorBg="bg-orange-50">
|
2026-01-14 20:00:35 -05:00
|
|
|
{data.name && <div>{data.name}</div>}
|
|
|
|
|
{data.operator && data.value !== undefined && (
|
|
|
|
|
<div className="text-xs text-gray-400">
|
|
|
|
|
{data.operator} {data.value}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</BaseNode>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
export const ConstraintNode = memo(ConstraintNodeComponent);
|