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

35 lines
1 KiB
TypeScript
Raw Normal View History

2021-12-16 09:02:22 -06:00
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import React, { useState } from 'react';
import { action } from '@storybook/addon-actions';
import type { Meta } from '@storybook/react';
2021-12-16 09:02:22 -06:00
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import type { PropsType } from './InstallScreenChoosingDeviceNameStep';
2021-12-16 09:02:22 -06:00
import { InstallScreenChoosingDeviceNameStep } from './InstallScreenChoosingDeviceNameStep';
const i18n = setupI18n('en', enMessages);
2022-06-06 20:48:02 -04:00
export default {
title: 'Components/InstallScreen/InstallScreenChoosingDeviceNameStep',
} satisfies Meta<PropsType>;
2021-12-16 09:02:22 -06:00
2022-11-17 16:45:19 -08:00
function Wrapper() {
const [deviceName, setDeviceName] = useState<string>('Default value');
return (
<InstallScreenChoosingDeviceNameStep
i18n={i18n}
deviceName={deviceName}
2024-03-15 07:20:33 -07:00
setBackupFile={action('setBackupFile')}
2022-11-17 16:45:19 -08:00
setDeviceName={setDeviceName}
onSubmit={action('onSubmit')}
/>
);
}
export function Default(): JSX.Element {
2021-12-16 09:02:22 -06:00
return <Wrapper />;
2022-11-17 16:45:19 -08:00
}