Skip to content

Commit

Permalink
feat(HorizontalFrame): 실제 api결과에 따른 Item 속성 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
seung365 committed Nov 14, 2024
1 parent 8953f83 commit 2942b28
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/pages/SearchResults/components/HorizontalFrame.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
import ArtistItem from '@/components/common/ArtistItem';
import ProductItem from '@/components/common/ProductItem';
import { SearchArtist, SearchWork } from '@/types/index';
import { SearchArtistInfo, SearchProductInfo } from '@/types/index';
import styled from '@emotion/styled';

interface HorizontalFrameProps {
children: SearchArtist[] | SearchWork[];
children: SearchArtistInfo[] | SearchProductInfo[];
}

const HorizontalFrame = ({ children }: HorizontalFrameProps) => {
return (
<HorizontalScrollWrapper>
{children.map((item) => (
<StyledItemWrapper key={item.id}>
{'title' in item && (
{'name' in item && (
<ProductItem
id={item.id}
author={item.artist}
title={item.title}
src={item.src}
title={item.name}
src={item.thumbnailUrl}
price={item.price}
key={item.id}
alt="artwork"
isLiked={false}
/>
)}
{'name' in item && (
{'nickname' in item && (
<ArtistItem
artistId={item.id}
author={item.name}
src={item.src}
author={item.nickname}
src={item.artistImageUrl}
like={item.totalLikes}
follower={item.totalFollowers}
key={item.id}
isFollow={item.followed}
isFollow={item.isFollowing}
alt="artist"
/>
)}
Expand Down

0 comments on commit 2942b28

Please sign in to comment.