import React, { memo } from '../../lib/teact/teact'; import type { ApiTopic } from '../../api/types'; import type { FC } from '../../lib/teact/teact'; import { getTopicColorCssVariable } from '../../util/forumColors'; import { REM } from './helpers/mediaDimensions'; import buildClassName from '../../util/buildClassName'; import renderText from './helpers/renderText'; import useLang from '../../hooks/useLang'; import TopicIcon from './TopicIcon'; import styles from './TopicChip.module.scss'; import blankSrc from '../../assets/blank.png'; type OwnProps = { topic?: ApiTopic; className?: string; onClick?: NoneToVoidFunction; }; const TOPIC_ICON_SIZE = 1.125 * REM; const TopicChip: FC = ({ topic, className, onClick, }) => { const lang = useLang(); return (
{topic ? : } {topic?.title ? renderText(topic.title) : lang('Loading')} {topic?.isClosed && }
); }; export default memo(TopicChip);