All files / src/components/pages/group/group-descriptions/description-sections/description-profile index.tsx

0% Statements 0/48
0% Branches 0/1
0% Functions 0/1
0% Lines 0/48

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49                                                                                                 
import Link from 'next/link';

import { ImageWithFallback } from '@/components/ui';
import { GetGroupDetailsResponse } from '@/types/service/group';

interface Props {
  hostInfo: GetGroupDetailsResponse['createdBy'];
  conditions: {
    isHost: boolean;
    isPast: boolean;
  };
  groupId: number;
}

export const DescriptionProfile = ({
  hostInfo: { userId, nickName, profileImage, profileMessage },
  conditions: { isHost, isPast },
  groupId,
}: Props) => {
  return (
    <div className='flex-between w-full select-none'>
      <Link href={`/profile/${userId}`} className='flex gap-3'>
        <ImageWithFallback
          width={40}
          className='object-fit h-10 w-10 shrink-0 rounded-full'
          alt='프로필 사진'
          draggable={false}
          height={40}
          src={profileImage ?? ''}
        />

        <div className='flex flex-col justify-center *:line-clamp-1'>
          <p className='text-text-md-semibold text-gray-800'>{nickName}</p>
          {profileMessage && <p className='text-text-xs-regular text-gray-600'>{profileMessage}</p>}
        </div>
      </Link>
      {isPast && <p className='text-text-xs-semibold pr-1 text-gray-500'>모임 마감</p>}
      {isHost && !isPast && (
        <Link
          href={`/create-group/${groupId}`}
          className='text-text-xs-semibold text-mint-500 pr-1'
        >
          모임 수정하기
        </Link>
      )}
    </div>
  );
};