feat(system): add label props to AlertDialog

This commit is contained in:
Pavel Prichodko 2022-03-31 15:14:01 +02:00
parent 43ab8e6240
commit 7ebd125370
No known key found for this signature in database
GPG Key ID: 0EB8D75C775AB6F1
1 changed files with 5 additions and 5 deletions

View File

@ -31,12 +31,12 @@ const AlertDialogTrigger = (props: TriggerProps) => {
interface DialogProps {
title: string
description: string
// actionLabel: string
// cancelLabel?: string
actionLabel: string
cancelLabel?: string
}
const AlertDialog = (props: DialogProps) => {
const { title, description } = props
const { title, description, cancelLabel = 'Cancel', actionLabel } = props
return (
<Primitive.Portal>
@ -57,10 +57,10 @@ const AlertDialog = (props: DialogProps) => {
</Body>
<Actions>
<Primitive.Cancel asChild>
<Button>Cancel</Button>
<Button>{cancelLabel}</Button>
</Primitive.Cancel>
<Primitive.Action asChild>
<Button>Action</Button>
<Button>{actionLabel}</Button>
</Primitive.Action>
</Actions>
</Content>