diff --git a/src/pages/Dashboard/MemoryCard/MemoryCard.tsx b/src/pages/Dashboard/MemoryCard/MemoryCard.tsx new file mode 100644 index 00000000..868376ea --- /dev/null +++ b/src/pages/Dashboard/MemoryCard/MemoryCard.tsx @@ -0,0 +1,73 @@ +import StandartLineChart from '../../../components/Charts/StandardLineChart' +import { Paragraph, Separator, XStack, YStack } from 'tamagui' +import { Shadow as ShadowBox, Text } from '@status-im/components' +import { CheckCircleIcon, IncorrectIcon } from '@status-im/icons' +import IconText from '../../../components/General/IconText' + +const MemoryCard = ({ currentMemory, maxMemory }: MemoryCardProps) => { + const chartData: ChartData[] = [ + { + id: 'cpu', + color: '#8DC6BC', + data: currentMemory.map((yValue, index: number) => ({ + x: index + 1, + y: yValue, + })), + maxValue: maxMemory, + }, + ] + const currentLoad = + chartData[0].data.length > 0 ? chartData[0].data[chartData[0].data.length - 1].y : 0 + + const message = currentLoad < maxMemory ? 'Good' : 'Poor' + + return ( + + + +
+ +
+ + + Memory + + + {currentLoad} GB + + +
+ + + : } + > + {message} + + {message === 'Poor' && ( + + {((currentLoad / maxMemory || 0) * 100).toFixed(0)}% Utilization + + )} + +
+
+ ) +} + +export default MemoryCard