import type { FC } from '../../../lib/teact/teact'; import React, { memo } from '../../../lib/teact/teact'; import type { ApiBotCommand, ApiUser } from '../../../api/types'; import renderText from '../../common/helpers/renderText'; import buildClassName from '../../../util/buildClassName'; import ListItem from '../../ui/ListItem'; import Avatar from '../../common/Avatar'; import './BotCommand.scss'; type OwnProps = { botCommand: ApiBotCommand; bot?: ApiUser; withAvatar?: boolean; focus?: boolean; onClick: (botCommand: ApiBotCommand) => void; }; const BotCommand: FC = ({ withAvatar, focus, botCommand, bot, onClick, }) => { return ( onClick(botCommand)} focus={focus} > {withAvatar && ( )}
/{botCommand.command} {renderText(botCommand.description)}
); }; export default memo(BotCommand);