import React from 'react'; import { ChatSettingsProps } from './props'; import { styles } from './styles'; import { ChatAvatars } from './ChatAvatars'; import { PeopleSettings } from './PeopleSettings'; import { PhotosSettings } from './PhotosSettings'; import { OptionsSettings } from './OptionsSettings'; export const ChatSettings: React.FC = ( props: ChatSettingsProps ) => { const { chat } = props; if (props.renderChatSettings) { return <>{props.renderChatSettings(props)}; } const people = chat ? chat.people.map((chatPerson) => chatPerson.person) : []; const otherPerson = chat && chat.people.find((person) => person.person.username !== props.username); const title = props.isLoading || !chat ? '' : chat.is_direct_chat && otherPerson ? otherPerson.person.username : chat.title; return (
{title}
); };