11import {
2+ User ,
23 type MarkdownMessageSchema ,
34 type Message ,
45 type ReplyMessageSchema ,
5- type ProfileSchema ,
6- type User ,
7- type ProfileOverride
6+ type UserProfile
87} from '@concrnt/worldlib'
98import { Box , IconButton , ListItem , type SxProps } from '@mui/material'
109import { Link as routerLink , useNavigate , useLocation } from 'react-router-dom'
@@ -16,9 +15,7 @@ export interface ContentWithCCAvatarProps {
1615 message ?: Message < MarkdownMessageSchema | ReplyMessageSchema >
1716 linkTo ?: string
1817 author ?: User
19- profileOverride ?: ProfileOverride
20- characterOverride ?: ProfileSchema
21- avatarOverride ?: string
18+ profile : UserProfile
2219 children ?: JSX . Element | Array < JSX . Element | undefined >
2320 sx ?: SxProps
2421 apId ?: string
@@ -37,16 +34,14 @@ export const ContentWithCCAvatar = (props: ContentWithCCAvatarProps): JSX.Elemen
3734 return (
3835 < >
3936 < Box itemProp = "author" itemScope itemType = "https://schema.org/Person" >
40- { props . author && (
37+ < >
38+ < meta itemProp = "identifier" content = { props . profile . ccid } />
39+ < meta itemProp = "url" content = { 'https://concrnt.world/' + props . profile . ccid } />
40+ </ >
41+ { props . profile . alias && < meta itemProp = "alternateName" content = { props . profile . alias } /> }
42+ { props . profile . username && (
4143 < >
42- < meta itemProp = "identifier" content = { props . author . ccid } />
43- < meta itemProp = "url" content = { 'https://concrnt.world/' + props . author . ccid } />
44- </ >
45- ) }
46- { props . author ?. alias && < meta itemProp = "alternateName" content = { props . author . alias } /> }
47- { props . author ?. profile ?. username && (
48- < >
49- < meta itemProp = "name" content = { props . author . profile . username } />
44+ < meta itemProp = "name" content = { props . profile . username } />
5045 </ >
5146 ) }
5247 </ Box >
@@ -73,11 +68,7 @@ export const ContentWithCCAvatar = (props: ContentWithCCAvatarProps): JSX.Elemen
7368 e . stopPropagation ( ) // prevent to navigate other page
7469 } }
7570 >
76- < ProfileTooltip
77- user = { props . author }
78- subProfileID = { props . profileOverride ?. profileID }
79- profileOverride = { props . profileOverride }
80- >
71+ < ProfileTooltip user = { props . author } profile = { props . profile } >
8172 < IconButton
8273 sx = { {
8374 width : { xs : '38px' , sm : '48px' } ,
@@ -88,15 +79,14 @@ export const ContentWithCCAvatar = (props: ContentWithCCAvatarProps): JSX.Elemen
8879 to = {
8980 apLink ??
9081 '/' +
91- ( props . author ? .ccid ?? '' ) +
92- ( props . profileOverride ?. profileID ? '#' + props . profileOverride . profileID : '' )
82+ ( props . profile . ccid ?? '' ) +
83+ ( props . profile . profileOverrideID ? '#' + props . profile . profileOverrideID : '' )
9384 }
9485 onPointerDown = { ( ) => profile . forceClose ( ) } // prevent to stick showing when clicking
9586 >
9687 < CCAvatar
97- avatarURL = { props . author ?. profile ?. avatar }
98- avatarOverride = { props . avatarOverride || props . profileOverride ?. avatar }
99- identiconSource = { props . author ?. ccid ?? '' }
88+ avatarURL = { props . profile . avatar }
89+ identiconSource = { props . profile . ccid }
10090 sx = { {
10191 width : { xs : '38px' , sm : '48px' } ,
10292 height : { xs : '38px' , sm : '48px' }
0 commit comments