import { Grid, Container, Typography } from '@mui/material'; import { blueGrey } from '@mui/material/colors'; import React, { useMemo } from 'react'; import useAuth from '../providers/AuthProvider'; import ConversationDetails from './ConversationDetails'; import useTerminal from './Terminal'; import { useRendersCount } from 'react-use'; export default function MainPanel() { const { user } = useAuth(); const { selectedConversation } = useTerminal(); // if selected conversation, show details // do all fetching necessary to paint things here // join the call so to speak // show who is const rendersCount = useRendersCount(); console.warn('RENDER COUNT | MAINPANEL | ', rendersCount); const pageContent = useMemo(() => { if (selectedConversation) return ; return ( {`Hi ${user.displayName?.split(' ')[0] ?? 'there'}!`} Start a conversation with one tap
or just take a breather.
); }, [selectedConversation, user]); return ( {pageContent} ); }