import React from 'react';
import {InstagramPostType, UserType} from '../../types';
import {TaggPost} from './';

interface TaggsFeedProps {
  user: UserType;
  socialHandle: string;
  posts: Array<InstagramPostType>;
}

const TaggsFeed: React.FC<TaggsFeedProps> = ({user, socialHandle, posts}) => {
  return (
    <>
      {posts?.map((post, index) => (
        <TaggPost
          key={index}
          post={{
            owner: user,
            social: 'Instagram',
            socialHandle: socialHandle,
            data: post,
          }}
        />
      ))}
    </>
  );
};

export default TaggsFeed;
