import React from 'react' import { layout } from './layout.js' import { streamLabel } from './names.js' export const STREAM_MIME = 'application/x-vanguard-stream' // Zero-height when empty. New streams in a custom layout wait here: drag a chip into the dock (any edge, any window, // or onto a tab bar to stack), or click it to add it as a new column on the right. export default function Tray({ onPlace }) { const pending = layout.use(s => s.pending) if (!pending.length) return null return (
{pending.map(s => (
{ e.dataTransfer.setData(STREAM_MIME, s.id); e.dataTransfer.setData('text/plain', s.id); e.dataTransfer.effectAllowed = 'move' }} onClick={() => onPlace(s.id, { direction: 'right' })}> ● {streamLabel(s.id, s)}
))}
) }