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.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
import type { WebhookLog } from '@/types/webhook';
export type DeliveryState = 'delivered' | 'failed' | 'pending';
export const deliveryState = (log: WebhookLog): DeliveryState => {
if (log.delivered_at) {
return 'delivered';
}
if (log.failed_at || (log.response_status ?? 0) >= 300) {
return 'failed';
}
return 'pending';
};
const deliveryBadgeVariants = {
delivered: 'success',
failed: 'destructive-subtle',
pending: 'secondary',
} as const satisfies Record<DeliveryState, string>;
export const deliveryBadgeVariant = (
log: WebhookLog,
): (typeof deliveryBadgeVariants)[DeliveryState] =>
deliveryBadgeVariants[deliveryState(log)];