Skip to content

⭐️⭐️⭐️ 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.

801 B
Raw Blame
'use client';

import { useMemo } from 'react';
import { useTranslations } from 'next-intl';
import type { GroupLabels } from '@/utils/project';
import { usePriorityLabel } from '@/hooks/usePriorityLabel';

// The names buildGroups needs beyond the project's own entities: the "No …" group
// of each nullable grouping field, and the priority values.
export function useGroupLabels(): GroupLabels {
  const t = useTranslations('workItems.groups');
  const priority = usePriorityLabel();
  return useMemo(
    () => ({
      noAssignee: t('noAssignee'),
      noDelegate: t('noDelegate'),
      noPriority: t('noPriority'),
      noType: t('noType'),
      noInitiative: t('noInitiative'),
      noCycle: t('noCycle'),
      noMember: t('noMember'),
      priority,
    }),
    [t, priority],
  );
}