import React from 'react' import { type Meta, type StoryObj } from '@storybook/react-vite' import { DocsTemplate } from '../../../.storybook' import ConfirmationPopoverContent from './ConfirmationPopoverContent' import { toast } from '../Toast/Toast' const meta: Meta = { title: 'Components/Popover/ConfirmationPopoverContent', component: ConfirmationPopoverContent, parameters: { design: { type: 'figma', url: 'https://www.figma.com/design/RvhKD82948FMQnh5MyCi0o/Web-Design-System?node-id=121-337&t=KUWdug3XS3dQ8hnl-0', }, docs: { page: () => ( The ConfirmationPopoverContent component is designed to display confirmation content within a popover. It includes a structured layout consisting of a header, body, and footer buttons, ensuring a consistent user experience for actions that require confirmation. The component also offers different color variations to visually distinguish between types of confirmations, such as warnings or approvals. } infoBullets={[ Use the ConfirmationPopoverContent component to present confirmation prompts within a popover, ensuring users can confirm or cancel actions before proceeding. , Implement footer buttons for the user to confirm or cancel the action. Typically, one button is styled as a primary action (e.g., “Confirm”), while the other is a secondary action (e.g., “Cancel”). , Leverage the different color variations to visually distinguish the type of confirmation (e.g., red for destructive actions, green for approvals), aligning with the application’s design system. , ]} /> ), }, }, } export default meta type Story = StoryObj const Template: Story = { render: (args) => , } export const Green: Story = { ...Template, args: { type: 'green', header: 'Are you sure?', body: ( This will perform some action. Would you like to continue? ), confirmCallout: () => { toast({ message: 'You clicked confirm!', type: 'success' }) }, cancelCallout: () => { toast({ message: 'You clicked cancel!', type: 'info' }) }, }, } export const Blue: Story = { ...Template, args: { type: 'blue', header: 'Are you sure?', body: 'This will perform some action. Would you like to continue?', confirmCallout: () => { toast({ message: 'You clicked confirm!', type: 'success' }) }, cancelCallout: () => { toast({ message: 'You clicked cancel!', type: 'info' }) }, }, } export const Red: Story = { ...Template, args: { type: 'red', header: 'Are you sure?', body: 'This will perform some action. Would you like to continue?', confirmCallout: () => { toast({ message: 'You clicked confirm!', type: 'success' }) }, cancelCallout: () => { toast({ message: 'You clicked cancel!', type: 'info' }) }, }, } export const CustomConfirmButtonText: Story = { ...Template, args: { type: 'green', header: 'Are you sure?', body: 'This will perform some action. Would you like to continue?', confirmCallout: () => { toast({ message: 'You clicked confirm!', type: 'success' }) }, cancelCallout: () => { toast({ message: 'You clicked cancel!', type: 'info' }) }, confirmButtonText: 'Yessir', }, }