mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-28 03:00:29 -04:00
Added router block; fixed hidden rendering on workflow block
This commit is contained in:
@@ -17,10 +17,6 @@ interface SubBlockProps {
|
||||
}
|
||||
|
||||
export function SubBlock({ blockId, config, isConnecting }: SubBlockProps) {
|
||||
if (config.hidden) {
|
||||
return null
|
||||
}
|
||||
|
||||
const handleMouseDown = (e: React.MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
}
|
||||
|
||||
@@ -89,11 +89,14 @@ export function WorkflowBlock({ id, type, config, name, selected }: WorkflowBloc
|
||||
}, [workflow.subBlocks, id, updateNodeInternals])
|
||||
|
||||
function groupSubBlocks(subBlocks: SubBlockConfig[]) {
|
||||
// Filter out hidden subblocks
|
||||
const visibleSubBlocks = subBlocks.filter(block => !block.hidden)
|
||||
|
||||
const rows: SubBlockConfig[][] = []
|
||||
let currentRow: SubBlockConfig[] = []
|
||||
let currentRowWidth = 0
|
||||
|
||||
subBlocks.forEach((block) => {
|
||||
visibleSubBlocks.forEach((block) => {
|
||||
const blockWidth = block.layout === 'half' ? 0.5 : 1
|
||||
if (currentRowWidth + blockWidth > 1) {
|
||||
rows.push([...currentRow])
|
||||
|
||||
Reference in New Issue
Block a user