Commit 622eecb4 authored by Yoon, Daeki's avatar Yoon, Daeki 😅
Browse files

불필요한 파일 제거 및 필요한 패키지 설치

parent 928486a6
import React from "react"; import React, { useState } from "react";
import { Pie } from "../charts/pies/Pie";
import { IQuestionData } from "../types"; import { IQuestionData } from "../types";
type Props = { type Props = {
...@@ -6,6 +7,8 @@ type Props = { ...@@ -6,6 +7,8 @@ type Props = {
}; };
export const RRadio = ({ question }: Props) => { export const RRadio = ({ question }: Props) => {
const [dataset, setDataset] = useState([50, 30, 12, 5, 3]);
const result = question.answers.reduce((acc: any, cur: any) => { const result = question.answers.reduce((acc: any, cur: any) => {
acc[cur] = (acc[cur] || 0) + 1; acc[cur] = (acc[cur] || 0) + 1;
return acc; return acc;
...@@ -22,6 +25,7 @@ export const RRadio = ({ question }: Props) => { ...@@ -22,6 +25,7 @@ export const RRadio = ({ question }: Props) => {
</span> </span>
</div> </div>
))} ))}
<Pie data={dataset} />
</div> </div>
); );
}; };
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment