ConceptPortal-public/rsconcept/frontend/src/features/help/components/subtopics.tsx
Ivan 575b7a29f2
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run
F: Accessibility improvements
2025-03-19 23:28:52 +03:00

23 lines
644 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { prefixes } from '@/utils/constants';
import { HelpTopic, topicParent } from '../models/help-topic';
import { TopicItem } from './topic-item';
interface SubtopicsProps {
headTopic: HelpTopic;
}
export function Subtopics({ headTopic }: SubtopicsProps) {
return (
<details>
<summary className='text-center font-semibold'>Содержание раздела</summary>
{Object.values(HelpTopic)
.filter(topic => topic !== headTopic && topicParent.get(topic) === headTopic)
.map(topic => (
<TopicItem key={`${prefixes.topic_item}${topic}`} topic={topic} />
))}
</details>
);
}