Skip to content

Commit

Permalink
✨feat: RelatedStockContent.jsx - 에러 컴포넌트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ShinHeeEul committed Jun 24, 2024
1 parent 3b4ead5 commit 1fd7014
Showing 1 changed file with 29 additions and 22 deletions.
51 changes: 29 additions & 22 deletions src/pages/main/RelatedStockContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,36 @@ export default function RelatedStock({ keyword }) {
></ContentHeader>
<Contents>
{/* 내용이 들어오면 변경 */}
{companies.length === 0
? Array.from({ length: STOCK_SIZE }).map((elem, index) => (
<StyledContentsDiv
width={STOCK_CONTENT_WIDTH}
height={STOCK_CONTENT_HEIGHT}
>
<Skeleton
key={index}
width={140}
height={40}
style={{ margin: "0.5rem" }}
/>
<Skeleton width={70} height={15} />
</StyledContentsDiv>
))
: companies.map((company) => (
<StockContent
key={company.id} // 고유한 key 속성을 사용하세요. 예를 들어 company.id 또는 company.name 등을 사용하세요.
company={company}
width={STOCK_CONTENT_WIDTH}
height={STOCK_CONTENT_HEIGHT}
{companies.length === 0 ? (
Array.from({ length: STOCK_SIZE }).map((elem, index) => (
<StyledContentsDiv
width={STOCK_CONTENT_WIDTH}
height={STOCK_CONTENT_HEIGHT}
>
<Skeleton
key={index}
width={140}
height={40}
style={{ margin: "0.5rem" }}
/>
))}
<Skeleton width={70} height={15} />
</StyledContentsDiv>
))
) : companies[0].similarity == 0 ? (
<img
style={{ width: "952px", height: "227px" }}
src="/assets/images/no-search.svg"
></img>
) : (
companies.map((company) => (
<StockContent
key={company.id} // 고유한 key 속성을 사용하세요. 예를 들어 company.id 또는 company.name 등을 사용하세요.
company={company}
width={STOCK_CONTENT_WIDTH}
height={STOCK_CONTENT_HEIGHT}
/>
))
)}
</Contents>
</StyledMainContentDiv>
);
Expand Down

0 comments on commit 1fd7014

Please sign in to comment.