@namespace Lumeo.Docs.Shared.Patterns

<Stack Gap="3">
<PatternCard Label="Confirm Delete" Code="@_codeAlertDialogDelete">
    <AlertDialog @bind-Open="_alertDialog1Open">
        <AlertDialogTrigger>
            <Button Variant="Button.ButtonVariant.Destructive">Delete Account</Button>
        </AlertDialogTrigger>
        <AlertDialogContent>
            <AlertDialogHeader>
                <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
                <AlertDialogDescription>This action cannot be undone. This will permanently delete your account and remove your data from our servers.</AlertDialogDescription>
            </AlertDialogHeader>
            <AlertDialogFooter>
                <AlertDialogCancel>Cancel</AlertDialogCancel>
                <AlertDialogAction>Delete</AlertDialogAction>
            </AlertDialogFooter>
        </AlertDialogContent>
    </AlertDialog>
</PatternCard>

<PatternCard Label="Basic Confirmation" Code="@_codeAlertDialogConfirm">
    <AlertDialog @bind-Open="_alertDialog2Open">
        <AlertDialogTrigger>
            <Button Variant="Button.ButtonVariant.Outline">Publish Changes</Button>
        </AlertDialogTrigger>
        <AlertDialogContent>
            <AlertDialogHeader>
                <AlertDialogTitle>Publish changes?</AlertDialogTitle>
                <AlertDialogDescription>Your changes will be visible to all users. You can revert at any time.</AlertDialogDescription>
            </AlertDialogHeader>
            <AlertDialogFooter>
                <AlertDialogCancel>Cancel</AlertDialogCancel>
                <AlertDialogAction>Publish</AlertDialogAction>
            </AlertDialogFooter>
        </AlertDialogContent>
    </AlertDialog>
</PatternCard>
</Stack>

@code {
    private bool _alertDialog1Open;

    private bool _alertDialog2Open;

        private string _codeAlertDialogDelete = @"<AlertDialog @bind-Open=""_open"">
        <AlertDialogTrigger>
            <Button Variant=""Button.ButtonVariant.Destructive"">Delete Account</Button>
        </AlertDialogTrigger>
        <AlertDialogContent>
            <AlertDialogHeader>
                <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
                <AlertDialogDescription>This action cannot be undone.</AlertDialogDescription>
            </AlertDialogHeader>
            <AlertDialogFooter>
                <AlertDialogCancel>Cancel</AlertDialogCancel>
                <AlertDialogAction>Delete</AlertDialogAction>
            </AlertDialogFooter>
        </AlertDialogContent>
    </AlertDialog>";

        private string _codeAlertDialogConfirm = @"<AlertDialog @bind-Open=""_open"">
        <AlertDialogTrigger>
            <Button Variant=""Button.ButtonVariant.Outline"">Publish Changes</Button>
        </AlertDialogTrigger>
        <AlertDialogContent>
            <AlertDialogHeader>
                <AlertDialogTitle>Publish changes?</AlertDialogTitle>
                <AlertDialogDescription>Your changes will be visible to all users.</AlertDialogDescription>
            </AlertDialogHeader>
            <AlertDialogFooter>
                <AlertDialogCancel>Cancel</AlertDialogCancel>
                <AlertDialogAction>Publish</AlertDialogAction>
            </AlertDialogFooter>
        </AlertDialogContent>
    </AlertDialog>";
}
