feat: tempcommit
This commit is contained in:
parent
6619f0a9eb
commit
8555fd919a
2 changed files with 87 additions and 58 deletions
35
src/components/misc/profile-picture-upload.tsx
Normal file
35
src/components/misc/profile-picture-upload.tsx
Normal file
|
@ -0,0 +1,35 @@
|
|||
import Image from 'next/image';
|
||||
import { Avatar } from '../ui/avatar';
|
||||
import { useGetApiUserMe } from '@/generated/api/user/user';
|
||||
import { User } from 'lucide-react';
|
||||
|
||||
import { Input } from '../ui/input';
|
||||
|
||||
export default function ProfilePictureUpload() {
|
||||
const { data } = useGetApiUserMe();
|
||||
return (
|
||||
<>
|
||||
<div className='grid grid-cols-1 gap-1'>
|
||||
<span className='relative flex space-6'>
|
||||
<Input
|
||||
id='pic-upload'
|
||||
type='file'
|
||||
defaultValue={data?.data.user.image ?? undefined}
|
||||
/>
|
||||
<Avatar className='flex justify-center items-center ml-6 shadow-md border h-[36px] w-[36px]'>
|
||||
{data?.data.user.image ? (
|
||||
<Image
|
||||
src={data?.data.user.image}
|
||||
alt='Avatar'
|
||||
width='20'
|
||||
height='20'
|
||||
/>
|
||||
) : (
|
||||
<User />
|
||||
)}
|
||||
</Avatar>
|
||||
</span>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue