include icon.pug
include status-indicator.pug
include action-button.pug

mixin side-nav
    -
        let classes = {
            'o-side-nav': true,
        }
        if (attributes.class) {
            classes[attributes.class] = true;
        }

    div(class=classes)&attributes(attributes)
        block

mixin side-nav-item
    -
        let classes = {
            'o-side-nav__item':   true,
            'l-media':        true,
            'l-media--sm':    true,
            'o-side-nav__header': attributes.header,
            'is-selected':    attributes.selected,
        }
        if (attributes.class) {
            classes[attributes.class] = true;
        }

    #{!!attributes.tag ? attributes.tag : 'button'}(class=classes)&attributes(attributes)
        if attributes.icon
            .l-media__block.o-side-nav__icon-slot
                if attributes.iconIsStatus
                    +status-indicator(attributes.icon)(class='o-side-nav__icon')
                else
                    +icon(attributes.icon)(class='o-side-nav__icon')
        .l-media__block.l-media__block--main&attributes({ class: attributes.contentClass })
            block
        if attributes.postIcon
            .l-media__block.o-side-nav__icon-slot
                +icon(attributes.postIcon)(class='o-side-nav__icon')

mixin side-nav-header
    header.o-side-nav__header
        block

mixin side-nav-separator
    .o-side-nav__separator