import { Avatar, Card, CardContent, CardHeader, Link as MUILink, Typography } from '@mui/material'; import { Link } from '@tanstack/react-router'; import { FC } from 'react'; import Api from '../../api/Api'; import { PostAuth, PostNonAuth } from '../../types/Post'; import convertDate from '../../utils/date'; interface Props { post: PostNonAuth | PostAuth; } const Post: FC = ({ post }) => { return ( ) : ( ) } title={ 'id' in post.user ? ( post.user.id !== Api.getAuthenticatedUser()?.id ? ( {post.user.username} ) : ( {post.user.username} ) ) : ( post.user.username ) } subheader={convertDate(post.postedAt)} /> {post.content} ); }; export default Post;