// import {UserIcon} from '@heroicons/react/24/solid' // import {LikeData, ShipData} from 'common/api/profile-types' // import {Profile} from 'common/profiles/profile' // import {keyBy, orderBy} from 'lodash' // import Image from 'next/image' // import Link from 'next/link' // import {Col} from 'web/components/layout/col' // import {SendMessageButton} from 'web/components/messaging/send-message-button' // import {Avatar, EmptyAvatar} from 'web/components/widgets/avatar' // import {Carousel} from 'web/components/widgets/carousel' // import {UserLink} from 'web/components/widgets/user-link' // import {useProfileByUserId} from 'web/hooks/use-profile' // import {useUser} from 'web/hooks/use-user' // import {useUserById} from 'web/hooks/use-user-supabase' // // import {Subtitle} from './profile-subtitle' // import {ShipsList} from './ships-display' // // export const LikesDisplay = (props: { // likesGiven: LikeData[] // likesReceived: LikeData[] // ships: ShipData[] // refreshShips: () => Promise // profileProfile: Profile // }) => { // const {likesGiven, likesReceived, ships, refreshShips, profileProfile} = props // // const likesGivenByUserId = keyBy(likesGiven, (l) => l.user_id) // const likesReceivedByUserId = keyBy(likesReceived, (l) => l.user_id) // const mutualLikeUserIds = Object.keys(likesGivenByUserId).filter( // (userId) => likesReceivedByUserId[userId], // ) // // const mutualLikes = mutualLikeUserIds.map((user_id) => { // const likeGiven = likesGivenByUserId[user_id] // const likeReceived = likesReceivedByUserId[user_id] // const created_time = Math.max(likeGiven.created_time, likeReceived.created_time) // return {user_id, created_time} // }) // const sortedMutualLikes = orderBy(mutualLikes, 'created_time', 'desc') // const onlyLikesGiven = likesGiven.filter((l) => !likesReceivedByUserId[l.user_id]) // const onlyLikesReceived = likesReceived.filter((l) => !likesGivenByUserId[l.user_id]) // // if ( // sortedMutualLikes.length === 0 && // onlyLikesReceived.length === 0 && // onlyLikesGiven.length === 0 && // ships.length === 0 // ) { // return null // } // // return ( // // {sortedMutualLikes.length > 0 && ( // // Mutual likes // // {sortedMutualLikes.map((like) => { // return ( // // ) // })} // // // )} // // {onlyLikesReceived.length > 0 && ( // // )} // {onlyLikesGiven.length > 0 && } // {ships.length > 0 && ( // // )} // // ) // } // // const LikesList = (props: {label: string; likes: LikeData[]}) => { // const {label, likes} = props // // const maxShown = 50 // const truncatedLikes = likes.slice(0, maxShown) // // return ( // // {label} // {truncatedLikes.length > 0 ? ( // // {truncatedLikes.map((like) => ( // // ))} // // ) : ( //
None
// )} // // ) // } // // const UserAvatar = (props: {userId: string; className?: string}) => { // const {userId, className} = props // const profile = useProfileByUserId(userId) // const user = useUserById(userId) // // // console.debug('UserAvatar', user?.username, profile?.pinned_url) // // if (!profile) return // return // } // // export const MatchTile = (props: {profileProfile: Profile; matchUserId: string}) => { // const {matchUserId, profileProfile} = props // const profile = useProfileByUserId(matchUserId) // const user = useUserById(matchUserId) // const currentUser = useUser() // const isYourMatch = currentUser?.id === profileProfile.user_id // // if (!profile || !user) return // const {pinned_url} = profile // // return ( // // // // // // {pinned_url ? ( // // {`${user.username}`} // // ) : ( // // // // )} // {isYourMatch && ( // // // // )} // // // ) // }