feat(system): add label props to AlertDialog

This commit is contained in:
Pavel Prichodko 2022-03-31 15:14:01 +02:00
parent 00363fd570
commit 92cbdc16fa
No known key found for this signature in database
GPG Key ID: 8E4C82D464215E83
1 changed files with 5 additions and 5 deletions

View File

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