Files
web/apps/scandic-web/components/Modal/modal.ts
Anton Gunnarsson d0b6f3f8b3 Merged in feat/sw-1314-transfer-sas-points (pull request #1508)
SW-1314 Transfer SAS points

Approved-by: Linus Flood
2025-03-18 10:07:05 +00:00

30 lines
689 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?: VoidFunction
title?: string
subtitle?: string
withActions?: boolean
hideHeader?: boolean
} & (
| { 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>>
}