<template>
  <span v-if="isPublished" class="icon-checkmark"></span>
  <span v-else class="icon-cross"></span>
</template>

<script lang="ts">
import { Component, Vue, Prop } from 'vue-property-decorator';
import { namespace } from 'vuex-class';

const PagesStore = namespace('pages');

@Component
export default class PageCrudColumnActions extends Vue {
  @Prop(Object) item!: any;
  @PagesStore.State('publishedPageIds') readonly publishedPageIds!: string[];
  get isPublished() {
    return this.publishedPageIds && this.publishedPageIds.includes(this.item.$item.id);
  }
}
</script>
