mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Update: all queries involving image now use ImageQueryValidationSchema
This commit is contained in:
27
src/components/Account/UserAvatar.tsx
Normal file
27
src/components/Account/UserAvatar.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { FC } from 'react';
|
||||
import Image from 'next/image';
|
||||
import { z } from 'zod';
|
||||
import GetUserSchema from '@/services/User/schema/GetUserSchema';
|
||||
|
||||
interface UserAvatarProps {
|
||||
user: {
|
||||
username: z.infer<typeof GetUserSchema>['username'];
|
||||
userAvatar: z.infer<typeof GetUserSchema>['userAvatar'];
|
||||
id: z.infer<typeof GetUserSchema>['id'];
|
||||
};
|
||||
}
|
||||
|
||||
const UserAvatar: FC<UserAvatarProps> = ({ user }) => {
|
||||
const { userAvatar } = user;
|
||||
return !userAvatar ? null : (
|
||||
<Image
|
||||
src={userAvatar.path}
|
||||
alt="user avatar"
|
||||
width={1000}
|
||||
height={1000}
|
||||
className="h-full w-full"
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default UserAvatar;
|
||||
Reference in New Issue
Block a user