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.

643 B
Raw Blame
import { getPlatformLabel } from '@/composables/usePlatformLogo';
import type { AccountIdentityData } from '@/types/analytics';
import { channelName } from '@/types/channel';

/**
 * A channel's name in Insights by the app's one rule, `channelName`, as the
 * sidebar shows it; its network for a row that kept neither name nor handle.
 */
export const accountLabel = (
    account: Pick<AccountIdentityData, 'username' | 'name' | 'platform'>,
): string => {
    const name = channelName({ display_name: account.name, username: account.username });

    if (name) {
        return name;
    }

    return getPlatformLabel(account.platform);
};