51 lines
1.1 KiB
TypeScript
51 lines
1.1 KiB
TypeScript
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
||
|
|
import { ProfileActions } from './ProfileActions';
|
||
|
|
|
||
|
|
const meta: Meta<typeof ProfileActions> = {
|
||
|
|
title: 'Components/Features/User/ProfileActions',
|
||
|
|
component: ProfileActions,
|
||
|
|
tags: ['autodocs'],
|
||
|
|
parameters: { layout: 'centered' },
|
||
|
|
};
|
||
|
|
|
||
|
|
export default meta;
|
||
|
|
type Story = StoryObj<typeof ProfileActions>;
|
||
|
|
|
||
|
|
export const HiddenWhenNotEditing: Story = {
|
||
|
|
args: { isEditing: false },
|
||
|
|
render: (args) => (
|
||
|
|
<div className="w-64">
|
||
|
|
<ProfileActions {...args} />
|
||
|
|
<p className="text-sm text-muted-foreground mt-2">(No buttons when not editing)</p>
|
||
|
|
</div>
|
||
|
|
),
|
||
|
|
};
|
||
|
|
|
||
|
|
export const Editing: Story = {
|
||
|
|
args: {
|
||
|
|
isEditing: true,
|
||
|
|
onCancel: () => {},
|
||
|
|
cancelLabel: 'Cancel',
|
||
|
|
saveLabel: 'Save',
|
||
|
|
},
|
||
|
|
render: (args) => (
|
||
|
|
<div className="w-64">
|
||
|
|
<ProfileActions {...args} />
|
||
|
|
</div>
|
||
|
|
),
|
||
|
|
};
|
||
|
|
|
||
|
|
export const Loading: Story = {
|
||
|
|
args: {
|
||
|
|
isEditing: true,
|
||
|
|
isLoading: true,
|
||
|
|
onCancel: () => {},
|
||
|
|
saveLabel: 'Save',
|
||
|
|
},
|
||
|
|
render: (args) => (
|
||
|
|
<div className="w-64">
|
||
|
|
<ProfileActions {...args} />
|
||
|
|
</div>
|
||
|
|
),
|
||
|
|
};
|