RFile.tsx 650 Bytes
Newer Older
1
2
3
4
5
import React, { Fragment } from "react";
import { baseImageUrl } from "../apis";

type Props = {
  question: any;
Jiwon Yoon's avatar
Jiwon Yoon committed
6
  answers: any;
7
8
};

Jiwon Yoon's avatar
Jiwon Yoon committed
9
export const RFile = ({ question, answers }: Props) => {
10
11
12
  console.log("question", question);
  return (
    <div className="m-5 flex justify-start items-center">
Jiwon Yoon's avatar
Jiwon Yoon committed
13
      {answers.map((answer: any, index: number) => (
14
15
16
17
18
19
20
21
22
23
24
25
26
        <Fragment key={index}>
          <img
            className="h-14"
            key={answer[0].url}
            alt="file"
            src={`${baseImageUrl}/${answer[0].url}`}
          />
          <div className="ml-3">{answer[0].name}</div>
        </Fragment>
      ))}
    </div>
  );
};