signal-desktop/ts/components/preferences/donations/DonateInputCardCvc.stories.tsx
automated-signal 44da91ec9f
Init card form validation
Co-authored-by: Jamie Kyle <113370520+jamiebuilds-signal@users.noreply.github.com>
2025-07-19 09:20:07 +10:00

25 lines
816 B
TypeScript

// Copyright 2025 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { action } from '@storybook/addon-actions';
import React, { useState } from 'react';
import { DonateInputCardCvc } from './DonateInputCardCvc';
import type { DonateInputCardCvcProps } from './DonateInputCardCvc';
import type { ComponentMeta } from '../../../storybook/types';
export default {
component: DonateInputCardCvc,
args: {
id: '',
value: '',
onValueChange: action('onValueChange'),
maxInputLength: 3,
onBlur: action('onBlur'),
},
} satisfies ComponentMeta<DonateInputCardCvcProps>;
export function Default(props: DonateInputCardCvcProps): JSX.Element {
const [value, setValue] = useState('');
return (
<DonateInputCardCvc {...props} value={value} onValueChange={setValue} />
);
}