children.astro
693 Bytes
---
import Match from './match.astro'
const { props: { parent, children, debug = 0, replacers, slotHandler, adjuster } } = 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} adjuster={adjuster}/>)
: !children ? ''
: <Match parent={parent} node={children} index={0} debug={nextDebug} replacers={replacers} slotHandler={slotHandler} adjuster={adjuster}/>
}