stale state conversation as part of onboarding
This commit is contained in:
@@ -31,7 +31,13 @@ import useTerminal from './Terminal';
|
|||||||
|
|
||||||
export default function ConversationDetails() {
|
export default function ConversationDetails() {
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
const { getUser, selectedConversation, selectConversation, isCloudDoingMagic } = useTerminal();
|
const {
|
||||||
|
getUser,
|
||||||
|
selectedConversation,
|
||||||
|
conversationContentMap,
|
||||||
|
selectConversation,
|
||||||
|
isCloudDoingMagic,
|
||||||
|
} = useTerminal();
|
||||||
|
|
||||||
const rendersCount = useRendersCount();
|
const rendersCount = useRendersCount();
|
||||||
console.warn('RENDER COUNT | CONVERSATION DETAILS | ', rendersCount);
|
console.warn('RENDER COUNT | CONVERSATION DETAILS | ', rendersCount);
|
||||||
@@ -79,58 +85,47 @@ export default function ConversationDetails() {
|
|||||||
// TODO: uncheck priority or not
|
// TODO: uncheck priority or not
|
||||||
// soft max of 10...not going to enforce by counting all in database, but relying on client side list of convos
|
// soft max of 10...not going to enforce by counting all in database, but relying on client side list of convos
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Container maxWidth={false} sx={{ position: 'relative', flex: 1, overflow: 'auto' }}>
|
|
||||||
<ConversationHistory />
|
|
||||||
|
|
||||||
{/* <Box
|
|
||||||
sx={{
|
|
||||||
position: 'absolute',
|
|
||||||
zIndex: 10,
|
|
||||||
bottom: 0,
|
|
||||||
right: 0,
|
|
||||||
padding: 3,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Fab color="primary" aria-label="add" size="medium">
|
|
||||||
<FiSun />
|
|
||||||
</Fab>
|
|
||||||
</Box> */}
|
|
||||||
</Container>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function ConversationHistory() {
|
|
||||||
const { isCloudDoingMagic, selectedConversation, conversationContentMap } = useTerminal();
|
|
||||||
|
|
||||||
const contentBlocks = useMemo(() => {
|
const contentBlocks = useMemo(() => {
|
||||||
return conversationContentMap[selectedConversation.id] ?? [];
|
return conversationContentMap[selectedConversation.id] ?? [];
|
||||||
}, [conversationContentMap, selectedConversation.id]);
|
}, [conversationContentMap, selectedConversation.id]);
|
||||||
|
|
||||||
if (contentBlocks.length === 0)
|
if (contentBlocks.length === 0) {
|
||||||
return (
|
return (
|
||||||
<Stack justifyContent={'center'} alignItems={'center'}>
|
<Container
|
||||||
<Typography variant="caption">Get the party started!</Typography>
|
maxWidth={false}
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Container maxWidth="xs">
|
|
||||||
<Stack
|
|
||||||
justifyContent={'flex-start'}
|
|
||||||
alignItems={'center'}
|
|
||||||
sx={{
|
sx={{
|
||||||
pt: 2,
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
gap: 2,
|
||||||
|
flex: 1,
|
||||||
|
background: 'white',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography variant="caption">today</Typography>
|
<Typography variant="h6">{`Ready?!`}</Typography>
|
||||||
|
<Typography variant="caption">Get the party started!</Typography>
|
||||||
|
<Typography variant="caption">Look at the controls at the bottom right!</Typography>
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
{contentBlocks.map((contentBlock) => (
|
return (
|
||||||
<Paper key={contentBlock.id} elevation={8} sx={{ p: 1, width: '100%' }}>
|
<Container maxWidth={false} sx={{ position: 'relative', flex: 1, overflow: 'auto' }}>
|
||||||
<Stack direction={'row'} alignItems="center">
|
<Container maxWidth="xs">
|
||||||
{/* <Stack spacing={2} direction={'row'} alignItems={'center'}>
|
<Stack
|
||||||
|
justifyContent={'flex-start'}
|
||||||
|
alignItems={'center'}
|
||||||
|
sx={{
|
||||||
|
pt: 2,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Typography variant="caption">today</Typography>
|
||||||
|
|
||||||
|
{contentBlocks.map((contentBlock) => (
|
||||||
|
<Paper key={contentBlock.id} elevation={8} sx={{ p: 1, width: '100%' }}>
|
||||||
|
<Stack direction={'row'} alignItems="center">
|
||||||
|
{/* <Stack spacing={2} direction={'row'} alignItems={'center'}>
|
||||||
<Avatar alt={'Arjun Patel'} src="https://mui.com/static/images/avatar/2.jpg" />
|
<Avatar alt={'Arjun Patel'} src="https://mui.com/static/images/avatar/2.jpg" />
|
||||||
|
|
||||||
<Typography color={'GrayText'} variant="overline">
|
<Typography color={'GrayText'} variant="overline">
|
||||||
@@ -138,26 +133,27 @@ function ConversationHistory() {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Stack> */}
|
</Stack> */}
|
||||||
|
|
||||||
<audio controls src={contentBlock.contentUrl} />
|
<audio controls src={contentBlock.contentUrl} />
|
||||||
|
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
ml: 'auto',
|
ml: 'auto',
|
||||||
color: 'GrayText',
|
color: 'GrayText',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FiPlay />
|
<FiPlay />
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Paper>
|
</Paper>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
{isCloudDoingMagic && (
|
{isCloudDoingMagic && (
|
||||||
<IconButton size="small" color="secondary">
|
<IconButton size="small" color="secondary">
|
||||||
<FiCloudRain />
|
<FiCloudRain />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
</Container>
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user