import type { Meta, StoryObj } from '@storybook/nextjs-vite' import { useState } from 'react' import { AuthShell, BackToLoginLink, PasswordResetForm } from '../../components/features/auth' const meta = { title: 'Auth/Password Reset', component: PasswordResetForm, parameters: { layout: 'fullscreen', docs: { description: { component: 'Password Reset from the auth redesign. Presentational + controlled: new password + confirm, then Cancel / Reset Password. Shown inside AuthShell without tabs; "Back to Login" sits in the shell footer on desktop.', }, }, }, tags: ['autodocs'], } satisfies Meta export default meta type Story = StoryObj /** Full page: password reset form + marketing panel (no tabs). */ function PasswordResetPage({ initialPassword = '', initialConfirm = '' }: { initialPassword?: string; initialConfirm?: string }) { const [password, setPassword] = useState(initialPassword) const [confirmPassword, setConfirmPassword] = useState(initialConfirm) const isValid = password.length >= 8 && password === confirmPassword return ( {}} />} > {}} onCancel={() => {}} onBackToLogin={() => {}} submitDisabled={!isValid} errors={{ confirmPassword: confirmPassword && password !== confirmPassword ? 'Passwords do not match' : undefined, }} /> ) } /** Empty fields, submit disabled. */ export const Empty: Story = { render: () => , } /** Both passwords entered and matching, submit enabled. */ export const Filled: Story = { render: () => , }