<template>
    <div class="rp_summary-item" :class="{'is-simple': simple}">
        <header class="rp_summary-header">
            <div class="report__model-title" :class="{'loading': loading}">
                <slot name="header-left">
                    {{ title }}
                </slot>
            </div>
            <div class="right-part">
                <slot name="header-right">
                </slot>
            </div>
        </header>
        <slot name="default"></slot>
    </div>
</template>

<script>
export default {
    name: 'L1appRpSummaryItem',

    props: {
        title: String,
        loading: {
            type: Boolean,
            default: false
        },
        simple: {
            type: Boolean,
            default: false
        }
    },
};
</script>

<style lang="less">

.rp_summary-item {
    &:not(.is-simple) {
        margin: 12px 10px;
        padding: 10px;
        padding-top: 0;
        // box-shadow: 0px 4px 8px rgba(0, 82, 212, 0.15);
        border-radius: 8px;
    }
    margin-top: 12px;
    background: @light-barkground-secondary;


    &.is-simple {
        .rp_summary-header {
            margin: 0 10px;
        }
    }

    .rp_summary-header {
        display: flex;
        width: 100%;

        .report__model-title {
            flex: 1;
            position: relative;
            display: flex;
            align-items: center;
            font-size: 17px;
            color: @light-label-primary;
            height: 42px;
            padding-left: 28px;
    
            &.is-link {
                color: @musePrimary;
            }
            &:not(.loading)::before {
                content: '';
                position: absolute;
                left: 2px;
                width: 12px;
                height: 12px;
                border-radius: 50%;
                background: @light-system-blue;
                z-index: 2;
            }
            &:not(.loading)::after {
                content: '';
                position: absolute;
                left: 11px;
                width: 12px;
                height: 12px;
                border-radius: 50%;
                background: #BADAFF;
                z-index: 1;
            }
        }
        .right-part {
            position: relative;
            flex-shrink: 0;
            display: flex;
            justify-content: center;
            align-items: center;
        }
    }
}

</style>