diff --git a/frontend/src/features/admin/groups/GroupDetail.tsx b/frontend/src/features/admin/groups/GroupDetail.tsx index ef461b9..e10b779 100644 --- a/frontend/src/features/admin/groups/GroupDetail.tsx +++ b/frontend/src/features/admin/groups/GroupDetail.tsx @@ -9,6 +9,7 @@ import type { GroupElementKind, GroupFilter, GroupMode, + ShowKind, } from '@/shared/api/types' import { useApiError } from '@/shared/lib/use-api-error' import { Badge } from '@/shared/ui/badge' @@ -30,6 +31,17 @@ import { import { DurationLabel } from './DurationLabel' import { GroupFilterPanel } from './GroupFilterPanel' +/** + * Что писать на бейдже позиции. Вид элемента («шоу») сам по себе бесполезен: в группе рекламы + * все строки — шоу, и подпись ничего не говорит. Показываем тип шоу, когда он известен: «Ролик», + * «Сериал», «Полнометражка», — и «Коллекция» для франшизы. + */ +function elementLabelKey(elementKind: GroupElementKind, showKind: ShowKind | null) { + return elementKind === 'Collection' || showKind === null + ? `admin.groups.elementKinds.${elementKind}` + : `admin.shows.kinds.${showKind}` +} + const EMPTY_FILTER: GroupFilter = {} export function GroupDetail({ groupId }: Readonly<{ groupId: string }>) { @@ -305,7 +317,7 @@ export function GroupDetail({ groupId }: Readonly<{ groupId: string }>) { {candidate.year} )} - {t(`admin.groups.elementKinds.${candidate.elementKind}`)} + {t(elementLabelKey(candidate.elementKind, candidate.showKind))} {candidate.alreadyInGroup && ( {t('admin.groups.alreadyIn')} @@ -360,7 +372,7 @@ export function GroupDetail({ groupId }: Readonly<{ groupId: string }>) { )} - {t(`admin.groups.elementKinds.${item.elementKind}`)} + {t(elementLabelKey(item.elementKind, item.showKind))} {t('admin.groups.units')}: {item.unitCount}