feat(system): add label props to AlertDialog
This commit is contained in:
parent
00363fd570
commit
92cbdc16fa
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue