import { Typography, IconButton, Box, useTheme } from '@mui/material' import { useSelector } from 'react-redux' import { State } from '../store/rootReducer' import { hexToNpub } from '../utils' import { Link } from 'react-router-dom' import { getProfileRoute } from '../routes' type Props = { username: string avatarContent: string handleClick: (event: React.MouseEvent) => void } const Username = ({ username, avatarContent, handleClick }: Props) => { const hexKey = useSelector((state: State) => state.auth.usersPubkey) return ( user-avatar {username} ) } export default Username type UserProps = { pubkey: string name: string image?: string } /** * This component will be used for the displaying username and profile picture. * If image is not available, robohash image will be displayed */ export const UserComponent = ({ pubkey, name, image }: UserProps) => { const theme = useTheme() const npub = hexToNpub(pubkey) const roboImage = `https://robohash.org/${npub}.png?set=set3` return ( User Image {name} ) }