import React from 'react';
import Image from 'next/image';

import {
  TYPE_INSTAGRAM,
  TYPE_MRSS,
  TYPE_MS_STREAM,
  TYPE_SHAREPOINT,
  TYPE_TEAMS,
  TYPE_TIKTOK,
  TYPE_ZOOM,
} from '@/modules/feeds/constants';

import { FeedsType } from '@/modules/feeds/SelfServeList/types';

import instagram from '@/assets/img/source-icons/instagram.svg';
import mrss from '@/assets/img/source-icons/mrss.svg';
import msStream from '@/assets/img/source-icons/ms_stream.svg';
import sharepoint from '@/assets/img/source-icons/sharepoint.svg';
import teams from '@/assets/img/source-icons/teams.svg';
import tiktok from '@/assets/img/source-icons/tiktok.svg';
import zoom from '@/assets/img/source-icons/zoom.svg';

const ICONS = {
  [TYPE_INSTAGRAM]: instagram,
  [TYPE_MS_STREAM]: msStream,
  [TYPE_SHAREPOINT]: sharepoint,
  [TYPE_TEAMS]: teams,
  [TYPE_ZOOM]: zoom,
  [TYPE_TIKTOK]: tiktok,
  [TYPE_MRSS]: mrss,
} as const;

type Props = {
  type: FeedsType;
};

export default function TypeCell({ type }: Props) {
  const Icon = ICONS[type] as HTMLImageElement;
  return <Image src={Icon} width={21} height={21} alt={type} title={type} />;
}
