Files
web/apps/scandic-web/components/Modal/modal.ts
Christian Andolf 8ca0aee25e fix(LOY-196): replace employee number with dummy value
add support for className to modal
2025-05-07 10:32:32 +02:00

31 lines
708 B
TypeScript

import type { Dispatch, SetStateAction } from "react"
export enum AnimationStateEnum {
unmounted = "unmounted",
hidden = "hidden",
visible = "visible",
}
export type AnimationState = keyof typeof AnimationStateEnum
export type ModalProps = {
onAnimationComplete?: () => void
title?: string
subtitle?: string
withActions?: boolean
hideHeader?: boolean
className?: string
} & (
| { trigger: JSX.Element; isOpen?: never; onToggle?: never }
| {
trigger?: never
isOpen: boolean
onToggle: (open: boolean) => void
}
)
export type InnerModalProps = Omit<ModalProps, "trigger"> & {
animation: AnimationState
setAnimation: Dispatch<SetStateAction<AnimationState>>
}