aboutsummaryrefslogtreecommitdiff
path: root/front-end/src/views/Blog/components/Channels/ChannelTable.vue
blob: ff27371adcc5eab50ecefeebd07caa596403e256 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<template>
    <thead>
        <tr>
            <th>Name</th>
            <th>Path</th>
            <th>Index</th>
            <th>Feed?</th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        <tr v-for="channel in $props.items" :key="channel.id" class="table-row">
            <td>
                {{ channel.name }}
            </td>
            <td>
                {{ channel.path }}
            </td>
            <td>
                {{ channel.index }}
            </td>
            <td>
                {{ feedEnabled(channel) }}
            </td>
            <td class="w-12">
                <button class="btn xs no-border" @click="openEdit(channel)">
                    <fa-icon icon="pencil" />
                </button>
            </td>
        </tr>
    </tbody>
</template>

<script setup lang="ts">
import { BlogChannel } from '@vnuge/cmnext-admin';

const emit = defineEmits(['open-edit'])
defineProps<{ items: BlogChannel[] }>()

const feedEnabled = (channel: BlogChannel) => channel.feed ? 'Enabled' : 'Disabled'
const openEdit = (channel: BlogChannel) => emit('open-edit', channel)

</script>