import React from "react"; import { useDispatch, useSelector } from "react-redux"; import Header from "../components/globals/Header"; import IconWrapper from "../components/globals/IconWrapper"; import { userProfileActions } from "../store/userProfileSlice"; import { modalActions } from "../store/modalSlice"; import useTime from "../hooks/useTime"; import Image from "../components/globals/Image"; function UserProfile() { const { visible, profile } = useSelector((state) => state.userProfileReducer); const dispatch = useDispatch(); const lastSeenTime = useTime(profile?.status?.lastSeen); return (
{/* Header bar */}
dispatch(userProfileActions.hideProfile())} className="" >

Profile

{profile.name && ( dispatch( modalActions.openModal({ type: "deleteContactModal", payload: { profile }, }) ) } > )}
{/* Avatar */}
{profile.name

{profile.name || profile.username}

{profile.status?.online ? "Online" : `last seen at ${lastSeenTime}`}

{/* Details */}
{/* Username */}
{/* At icon */}
{profile.username} Username
{/* Bio */} {profile.bio && (
{/* Info icon */}

{profile.bio}

Bio
)}
); } export default UserProfile;