<script>
import { mapGetters } from 'vuex'
import BroadcasDeployPanel from './components/BroadcasDeployPanel'

export default {
  name: 'BroadcastDeploy',
  components: {
    BroadcasDeployPanel
  },
  computed: {
    ...mapGetters(['isSuperAdmin'])
  },
  render (h) {
    return this.isSuperAdmin
      ? h('TenantPage', {
        scopedSlots: {
          default ({ group }) {
            return group
              ? h('BroadcasDeployPanel', {
                props: {
                  tenant: group.path
                }
              })
              : null
          }
        }
      })
      : h('Wrapper', {
        props: {
          fill: true,
          margin: true,
          padding: true,
          background: true
        }
      }, [h('BroadcasDeployPanel')])
  }
}
</script>
