22/* eslint-disable @typescript-eslint/no-explicit-any */
33import { MUIDataTableColumn , MUIDataTableMeta } from 'mui-datatables' ;
44import { FacebookShareButton , LinkedinShareButton , TwitterShareButton } from 'react-share' ;
5- import { Avatar , Box , Grid , Typography } from '../../base' ;
6- import { CLOUD_URL } from '../../constants/constants' ;
75import { iconMedium } from '../../constants/iconsSizes' ;
86import {
97 ChainIcon ,
@@ -12,16 +10,15 @@ import {
1210 FacebookIcon ,
1311 KanvasIcon ,
1412 LinkedinIcon ,
15- PersonIcon ,
1613 PublishIcon ,
1714 TwitterIcon
1815} from '../../icons' ;
1916import { downloadFilter , downloadYaml } from '../CatalogDetail/helper' ;
2017import { RESOURCE_TYPES } from '../CatalogDetail/types' ;
2118import { Pattern } from '../CustomCatalog/CustomCard' ;
22- import { CustomTooltip } from '../CustomTooltip' ;
2319import { ConditionalTooltip } from '../Helpers/CondtionalTooltip' ;
2420import { DataTableEllipsisMenu } from '../ResponsiveDataTable' ;
21+ import AuthorCell from './AuthorCell' ;
2522import { NameDiv } from './style' ;
2623
2724export type ColView = [ string , 'na' | 'xs' | 'l' ] ;
@@ -141,47 +138,15 @@ export const createDesignColumns = ({
141138 const lastName = getColumnValue ( tableMeta , 'last_name' ) ;
142139 const avatar_url = getColumnValue ( tableMeta , 'avatar_url' ) ;
143140 const user_id = getColumnValue ( tableMeta , 'user_id' ) ;
144- const displayName =
145- firstName && lastName
146- ? `${ firstName } ${ lastName } `
147- : firstName
148- ? firstName
149- : lastName
150- ? lastName
151- : '' ;
152141
153142 return (
154- < Box sx = { { '& > img' : { mr : 2 , flexShrink : 0 } } } >
155- < Grid
156- container
157- alignItems = "center"
158- style = { maxWidth ? { width : 'max-content' } : { width : '' } }
159- >
160- < Grid item >
161- < Box sx = { { color : 'text.secondary' , mr : 1 } } >
162- < CustomTooltip title = { `View ${ displayName } 's Profile` } >
163- < div >
164- < Avatar
165- style = { { cursor : 'pointer' } }
166- alt = { displayName }
167- src = { avatar_url }
168- onClick = { ( ) => {
169- window . open ( `${ CLOUD_URL } /user/${ user_id } ` , '_blank' ) ;
170- } }
171- >
172- { ! avatar_url && < PersonIcon /> }
173- </ Avatar >
174- </ div >
175- </ CustomTooltip >
176- </ Box >
177- </ Grid >
178- { maxWidth && (
179- < Grid item >
180- < Typography variant = "body2" > { displayName } </ Typography >
181- </ Grid >
182- ) }
183- </ Grid >
184- </ Box >
143+ < AuthorCell
144+ firstName = { firstName }
145+ lastName = { lastName }
146+ avatarUrl = { avatar_url }
147+ userId = { user_id }
148+ maxWidth = { maxWidth }
149+ />
185150 ) ;
186151 }
187152 }
0 commit comments