fix dashboards and add empty state

This commit is contained in:
João Geonizeli
2022-07-27 22:41:22 -03:00
parent 7489cab78e
commit 89f39f93e9
4 changed files with 29 additions and 19 deletions

View File

@@ -17,22 +17,26 @@ export const Pie: FC<Props> = ({title, data}) => {
style={{ height: '36rem', width: '36rem' }}
>
<h3 className="text-lg leading-6 font-medium text-gray-900">{title}</h3>
<ResponsivePie
data={data}
margin={{top: 40, right: 80, bottom: 80, left: 80}}
innerRadius={0.5}
padAngle={0.7}
cornerRadius={3}
activeOuterRadiusOffset={8}
borderWidth={1}
borderColor={{from: 'color', modifiers: [['darker', 0.2]]}}
arcLinkLabelsSkipAngle={10}
arcLinkLabelsTextColor="#333333"
arcLinkLabelsThickness={2}
arcLinkLabelsColor={{from: 'color'}}
arcLabelsSkipAngle={10}
arcLabelsTextColor={{from: 'color', modifiers: [['darker', 2]]}}
/>
{data.length ? (
<ResponsivePie
data={data}
margin={{top: 40, right: 80, bottom: 80, left: 80}}
innerRadius={0.5}
padAngle={0.7}
cornerRadius={3}
activeOuterRadiusOffset={8}
borderWidth={1}
borderColor={{from: 'color', modifiers: [['darker', 0.2]]}}
arcLinkLabelsSkipAngle={10}
arcLinkLabelsTextColor="#333333"
arcLinkLabelsThickness={2}
arcLinkLabelsColor={{from: 'color'}}
arcLabelsSkipAngle={10}
arcLabelsTextColor={{from: 'color', modifiers: [['darker', 2]]}}
/>
) : (
<div className='grid items-center text-center h-full'>Não existem dados disponíveis.</div>
)}
</div>
)
}