ConceptPortal-public/rsconcept/frontend/src/features/help/components/subtopics.tsx

23 lines
644 B
TypeScript
Raw Normal View History

2024-05-16 14:01:06 +03:00
import { prefixes } from '@/utils/constants';
2025-03-12 11:55:43 +03:00
import { HelpTopic, topicParent } from '../models/help-topic';
2025-02-12 21:36:25 +03:00
2025-03-12 11:55:43 +03:00
import { TopicItem } from './topic-item';
2024-05-16 14:01:06 +03:00
interface SubtopicsProps {
headTopic: HelpTopic;
}
export function Subtopics({ headTopic }: SubtopicsProps) {
2024-05-16 14:01:06 +03:00
return (
2025-03-19 23:28:52 +03:00
<details>
<summary className='text-center font-semibold'>Содержание раздела</summary>
2024-05-16 14:01:06 +03:00
{Object.values(HelpTopic)
.filter(topic => topic !== headTopic && topicParent.get(topic) === headTopic)
.map(topic => (
<TopicItem key={`${prefixes.topic_item}${topic}`} topic={topic} />
))}
2025-03-19 23:28:52 +03:00
</details>
2024-05-16 14:01:06 +03:00
);
}