children.astro
643 Bytes
---
import Match from './match.astro'
const { props: { parent, children, debug = 0, replacers, slotHandler } } = Astro
//console.log('Children:render', { parent, children, replacers })
if (debug) {
console.log('children.astro:debug', { parent, children, replacers })
}
const nextDebug = debug ? debug - 1 : 0
---
{
Array.isArray(children) ?
children.map((child, index) => <Match parent={parent} node={child} index={index} debug={nextDebug} replacers={replacers} slotHandler={slotHandler}/>)
: !children ? ''
: <Match parent={parent} node={children} index={0} debug={nextDebug} replacers={replacers} slotHandler={slotHandler}/>
}