Skip to content

Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.

1.8 KB
Raw Blame
<script setup lang="ts">
import { computed } from 'vue';

import PostStatusBadge from '@/components/publish/PostStatusBadge.vue';
import {
    Popover,
    PopoverContent,
    PopoverTrigger,
} from '@/components/ui/popover';
import { getPlatformLabel } from '@/composables/usePlatformLogo';
import { transform } from '@/lib/helpers';
import type { PostCard } from '@/types/publish';

const props = defineProps<{
    post: PostCard;
    testKey: string;
}>();

const network = computed(() =>
    transform(props.post.platform, getPlatformLabel, ''),
);
</script>

<template>
    <Popover>
        <PopoverTrigger as-child>
            <button
                type="button"
                class="rounded-full focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring"
                :aria-label="
                    $t('posts.publish.deleted_on_network.title', { network })
                "
                :data-testid="`post-deleted-on-network-${testKey}`"
            >
                <PostStatusBadge
                    status="deleted_on_network"
                    class="cursor-pointer"
                />
            </button>
        </PopoverTrigger>
        <PopoverContent
            align="start"
            :collision-padding="16"
            class="flex w-80 flex-col gap-2"
            :data-testid="`post-deleted-on-network-popover-${testKey}`"
        >
            <p class="text-sm font-emphasis text-foreground">
                {{ $t('posts.publish.deleted_on_network.title', { network }) }}
            </p>
            <p
                class="text-sm text-foreground"
                :data-testid="`post-deleted-on-network-hint-${testKey}`"
            >
                {{ $t('posts.publish.deleted_on_network.hint') }}
            </p>
        </PopoverContent>
    </Popover>
</template>