17
src/components/profile/profile.container.tsx
Normal file
17
src/components/profile/profile.container.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { useUpdateUser } from '@/hooks/data/useUpdateUser';
|
||||
import { useOtherUserInfo } from '@/hooks/data/useUserInfo';
|
||||
import { utf8ToBase64 } from '@/lib/utils';
|
||||
import { ProfileView } from './profile.view';
|
||||
|
||||
export function ProfileContainer({ userId }: { userId: string }) {
|
||||
const { data } = useOtherUserInfo(userId);
|
||||
const { mutateAsync } = useUpdateUser();
|
||||
return (
|
||||
<ProfileView
|
||||
user={data.data!}
|
||||
onSaveBio={async (bio) => {
|
||||
await mutateAsync({ body: { bio: utf8ToBase64(bio) } });
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user