Add story for consensus

This commit is contained in:
Hristo Nedelkov 2023-08-15 13:21:37 +03:00
parent 59bcd20428
commit 91ceef7e72
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,37 @@
import type { Meta, StoryObj } from '@storybook/react'
import SyncStatusCardConsensus from './SyncStatusCardConsensus'
const meta = {
title: 'General/SyncStatusCardConsensus',
component: SyncStatusCardConsensus,
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
decorators: [
Story => (
<div style={{ height: '25vh' }}>
<Story />
</div>
),
],
} satisfies Meta<typeof SyncStatusCardConsensus>
export default meta
type Story = StoryObj<typeof meta>
export const WithData: Story = {
args: {
synced: 132432,
total: 200000,
},
}
export const WithoutData: Story = {
args: {
synced: 0,
total: 0,
},
}

View File

@ -21,7 +21,7 @@ const SyncStatusCardConsensus: React.FC<DeviceStorageHealthProps> = ({ synced, t
{
id: 'storage',
label: 'Free',
value: total - synced,
value: total - synced || 1,
color: '#E7EAEE',
},
]