//
// Copyright 2022 DXOS.org
//
import { type Meta, type StoryObj } from '@storybook/react-vite';
import React from 'react';
import { random } from '@dxos/random';
import { withTheme } from '../../testing';
import { Button } from '../Button';
import { AlertDialog } from './AlertDialog';
type StoryArgs = Partial<{
title: string;
description: string;
openTrigger: string;
cancelTrigger: string;
actionTrigger: string;
}>;
const DefaultStory = ({ title, description, openTrigger, cancelTrigger, actionTrigger }: StoryArgs) => {
return (
{title}
{description}
);
};
const meta = {
title: 'ui/react-ui-core/components/AlertDialog',
component: AlertDialog.Root as any,
render: DefaultStory as any,
decorators: [withTheme()],
} satisfies Meta;
export default meta;
type Story = StoryObj;
export const Default: Story = {
args: {
title: random.lorem.sentence(3),
description: random.lorem.paragraph(1),
openTrigger: 'Open AlertDialog',
cancelTrigger: 'Cancel',
actionTrigger: 'Action',
},
};