⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.
TypeScript agenticagileai-agentsbug-reportingbug-trackerganttissue-trackerjirajira-alternativekanbanlinearlinear-alternativeopen-sourceproduct-managementproject-managementroadmapself-hostedsprint-planningteam-collaborationtrello-alternative
import { useTranslations } from 'next-intl';
import { useTeamsQuery } from '@/services/teams.service';
// Names the teams a project template is open to: all of the workspace, none once the
// teams it was limited to are deleted, or those teams.
export function useTemplateTeamsLabel(): (teamIds: number[] | null) => string {
const t = useTranslations('teams.templates');
const teams = useTeamsQuery().data;
return (teamIds) => {
if (teamIds === null) return t('allTeams');
if (teamIds.length === 0) return t('noTeams');
return teamIds.flatMap((id) => teams?.find((team) => team.id === id)?.name ?? []).join(', ');
};
}