> For the complete documentation index, see [llms.txt](https://jihees-organization.gitbook.io/928m.archive/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jihees-organization.gitbook.io/928m.archive/readme/23.10..md).

# 리팩토링(23.10.)

AS-IS

```tsx
function CommunityPostCardImage({
  src,
  alt,
  locked,
}: CommunityPostCardImageProps) {
  const firstThumbnailURL = src[0];
  const secondThumbnailURL = src[1];
  const thirdThumbnailURL = src[2];

  if (locked) {
    return (
      <div className="flex justify-center items-center relative mt-[16px] relative w-full pt-[75%] rounded-[8px] overflow-hidden">
        <Image
          src={firstThumbnailURL}
          blurDataURL={firstThumbnailURL}
          layout="fill"
          placeholder="blur"
          sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
          alt={alt}
        />
      </div>
    );
  }

  if (src.length === 1) {
    return (
      <>
        <div className="relative flex w-full justify-center pt-[75%] rounded-[8px] shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)] overflow-hidden">
          <Image
            src={firstThumbnailURL}
            blurDataURL={firstThumbnailURL}
            placeholder="blur"
            layout="fill"
            sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
            alt="썸네일 이미지"
          />
          <div className="w-full h-[100%] absolute top-0 left-0 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)] rounded-[8px]" />
        </div>
      </>
    );
  }

  if (src.length === 2) {
    return (
      <div className="flex gap-[4px] justify-center items-center relative mt-[16px]">
        <div className="relative w-full pt-[75%] rounded-l-lg overflow-hidden">
          <Image
            src={firstThumbnailURL}
            blurDataURL={firstThumbnailURL}
            layout="fill"
            placeholder="blur"
            sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
            alt="썸네일 이미지"
          />
          <div className="w-full h-[100%] absolute top-0 left-0 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)] rounded-l-lg" />
        </div>

        <div className="relative w-full pt-[75%] rounded-r-lg overflow-hidden">
          <Image
            src={secondThumbnailURL}
            blurDataURL={firstThumbnailURL}
            layout="fill"
            placeholder="blur"
            sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
            alt="썸네일 이미지"
          />
          <div className="w-full h-[100%] absolute top-0 left-0 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)] rounded-r-lg" />
        </div>
      </div>
    );
  }

  if (src.length >= 3) {
    return (
      <div className="flex gap-[4px] justify-center items-center relative">
        <div className="relative w-[50%] pt-[75%] rounded-l-lg overflow-hidden">
          <Image
            src={firstThumbnailURL}
            blurDataURL={firstThumbnailURL}
            layout="fill"
            placeholder="blur"
            sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
            alt="썸네일 이미지"
          />
          <div className="w-full h-[100%] absolute top-0 left-0 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)] rounded-l-lg" />
        </div>
        <div className="flex flex-col gap-[4px] w-[50%]">
          <div className="relative w-full pt-[75%] rounded-tr-lg overflow-hidden">
            <Image
              src={secondThumbnailURL}
              blurDataURL={secondThumbnailURL}
              layout="fill"
              placeholder="blur"
              sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
              alt="썸네일 이미지"
            />
            <div className="w-full h-[100%] absolute top-0 left-0 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)] rounded-tr-lg" />
          </div>
          <div className="relative w-full pt-[75%] rounded-br-lg overflow-hidden">
            <Image
              src={thirdThumbnailURL}
              blurDataURL={thirdThumbnailURL}
              layout="fill"
              placeholder="blur"
              sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
              alt="썸네일 이미지"
            />
            <div className="w-full h-[100%] absolute top-0 left-0 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.1)] rounded-br-lg" />
            {src.length > 3 && (
              <span
                className="flex justify-center items-center w-full h-[100%]
              absolute top-0 left-0 dimmed_40 content_primary_inverse font_headline_bold_md"
              >
                +{src.length - 3}
              </span>
            )}
          </div>
        </div>
      </div>
    );
  } else {
    return null;
  }
}
```

TO-BE

```tsx
function CommunityPostCardImage({
  src,
  alt,
}: CommunityPostCardImageProps) {
  const [firstThumbnailURL, secondThumbnailURL, thirdThumbnailURL] = src;

  return (
    <>
      {src.length === 1 && (
        <SingleThumbnailDisplay thumbnailUrl={firstThumbnailURL} alt={alt} />
      )}
      {src.length === 2 && (
        <DoubleThumbnailDisplay
          firstThumbnailURL={firstThumbnailURL}
          secondThumbnailURL={secondThumbnailURL}
          alt={alt}
        />
      )}
      {src.length >= 3 && (
        <TripleThumbnailDisplay
          firstThumbnailURL={firstThumbnailURL}
          secondThumbnailURL={secondThumbnailURL}
          thirdThumbnailURL={thirdThumbnailURL}
          totalThumbnailLength={src.length}
          alt={alt}
        />
      )}
    </>
  );
}

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://jihees-organization.gitbook.io/928m.archive/readme/23.10..md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
