11import dynamic from 'next/dynamic' ;
22import styled , { useTheme } from 'styled-components' ;
3- import { RANK } from '@type/common' ;
4- import { ProfileUserResponse } from '@type/response' ;
3+ import { HistoryType , RANK , ScoreHistory } from '@type/common' ;
54import { Tooltip } from '@components/Chart' ;
65import { TIER_OFFSET } from '@utils/constants' ;
76import {
@@ -15,14 +14,16 @@ const PieChart = dynamic(() => import('@components/Chart/PieChart'), { ssr: fals
1514const LineChart = dynamic ( ( ) => import ( '@components/Chart/LineChart' ) , { ssr : false } ) ;
1615
1716interface ContributionStatisticProps {
18- data : ProfileUserResponse ;
17+ history : HistoryType ;
18+ scoreHistory : ScoreHistory [ ] ;
19+ tier : RANK ;
1920}
2021
21- function Statistic ( { data } : ContributionStatisticProps ) {
22+ function Statistic ( { history , scoreHistory , tier } : ContributionStatisticProps ) {
2223 const theme = useTheme ( ) ;
23- const pieChartData = transToPieChartData ( data . history ) ;
24- const contributionHistoryData = transContributionHistoryToLineChartData ( data . history . contributionHistory , data . tier ) ;
25- const scoreHistoryData = transScoreHistoryToLineChartData ( data . scoreHistory , data . tier ) ;
24+ const pieChartData = transToPieChartData ( history ) ;
25+ const contributionHistoryData = transContributionHistoryToLineChartData ( history . contributionHistory , tier ) ;
26+ const scoreHistoryData = transScoreHistoryToLineChartData ( scoreHistory , tier ) ;
2627 const { min, max } = getLineChartMinMaxValue ( scoreHistoryData ) ;
2728
2829 return (
0 commit comments