diondiondion 9d751370d5 [Glitch] Allow adding an account to a collection directly from the profile page
Port 6e7e8de3435c2a11715eecca97ddd92e1a2df3ea to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2026-05-20 15:48:18 +02:00

19 lines
755 B
TypeScript

import type { ApiMutedAccountJSON } from '@/flavours/glitch/api_types/accounts';
import type { Account } from '@/flavours/glitch/models/account';
import { isServerFeatureEnabled } from '@/flavours/glitch/utils/environment';
export function areCollectionsEnabled() {
return isServerFeatureEnabled('collections');
}
export const getCollectionPath = (id: string) => `/collections/${id}`;
export const canAccountBeAdded = (account: ApiMutedAccountJSON | Account) =>
['automatic', 'manual'].includes(account.feature_approval.current_user);
export const canAccountBeAddedByFollowers = (
account: ApiMutedAccountJSON | Account,
) =>
account.feature_approval.automatic.includes('followers') ||
account.feature_approval.manual.includes('followers');