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.

789 B
Raw Blame
import { router } from '@inertiajs/vue3';
import { readonly, ref, shallowReadonly, shallowRef } from 'vue';

import type { ChangelogEntry } from '@/types/changelog';

const isOpen = ref(false);
const entry = shallowRef<ChangelogEntry | null>(null);

const openList = (): void => {
    entry.value = null;
    isOpen.value = true;
};

const openEntry = (selected: ChangelogEntry): void => {
    entry.value = selected;
    isOpen.value = true;
};

const backToList = (): void => {
    entry.value = null;
};

const close = (): void => {
    isOpen.value = false;
    entry.value = null;
};

router.on('navigate', close);

export const useChangelogDialog = () => ({
    isOpen: readonly(isOpen),
    entry: shallowReadonly(entry),
    openList,
    openEntry,
    backToList,
    close,
});