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

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