signal-desktop/ts/components/installScreen/InstallScreenBackupImportStep.stories.tsx

44 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-08-27 21:00:41 +00:00
// Copyright 2024 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import type { Meta, StoryFn } from '@storybook/react';
2024-09-11 18:03:18 +00:00
import { action } from '@storybook/addon-actions';
2024-09-04 02:56:13 +00:00
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import type { PropsType } from './InstallScreenBackupImportStep';
import { InstallScreenBackupImportStep } from './InstallScreenBackupImportStep';
2024-08-27 21:00:41 +00:00
const i18n = setupI18n('en', enMessages);
export default {
2024-09-04 02:56:13 +00:00
title: 'Components/InstallScreenBackupImportStep',
2024-08-27 21:00:41 +00:00
} satisfies Meta<PropsType>;
// eslint-disable-next-line react/function-component-definition
const Template: StoryFn<PropsType> = (args: PropsType) => (
2024-09-11 18:03:18 +00:00
<InstallScreenBackupImportStep
{...args}
i18n={i18n}
onCancel={action('onCancel')}
/>
2024-08-27 21:00:41 +00:00
);
export const NoBytes = Template.bind({});
NoBytes.args = {
currentBytes: undefined,
totalBytes: undefined,
};
export const Bytes = Template.bind({});
Bytes.args = {
2024-09-11 18:03:18 +00:00
currentBytes: 500 * 1024,
totalBytes: 1024 * 1024,
};
export const Full = Template.bind({});
Full.args = {
currentBytes: 1024,
2024-08-27 21:00:41 +00:00
totalBytes: 1024,
};