feat(alert): expand alert popup func

This commit is contained in:
en 2025-02-14 13:00:59 +01:00
parent b71993adaa
commit 89d7131f7d

View File

@ -1,12 +1,16 @@
import { createPortal } from 'react-dom'
import { PropsWithChildren } from 'react'
import { AlertPopupProps } from 'types'
export const AlertPopup = ({
header,
label,
handleConfirm,
handleClose
}: AlertPopupProps) => {
handleClose,
yesButtonLabel = 'Yes',
noButtonLabel = 'No',
children
}: PropsWithChildren<AlertPopupProps>) => {
return createPortal(
<div className='popUpMain'>
<div className='ContainerMain'>
@ -38,6 +42,7 @@ export const AlertPopup = ({
>
{label}
</label>
{children}
</div>
<div
style={{
@ -51,14 +56,14 @@ export const AlertPopup = ({
type='button'
onPointerDown={() => handleConfirm(true)}
>
Yes
{yesButtonLabel}
</button>
<button
className='btn btnMain btnMainPopup'
type='button'
onPointerDown={() => handleConfirm(false)}
>
No
{noButtonLabel}
</button>
</div>
</div>