import { View } from '@tarojs/components'; import type { MlModalProps } from './types'; import { classNames } from 'mixlea-utils-js'; import { useMemoFn } from 'mixlea-hooks-react'; import { useSetStatus, useStatusState } from './contexts/status'; import { type PropsWithChildren } from 'react'; import { stopEvent } from './tools/stop-event'; export function Panel({ placement, panelStyle, panelClassName, children, }: PropsWithChildren>) { const status = useStatusState(); const setStatus = useSetStatus(); const handleAnimationEnd = useMemoFn((e: any) => { e.stopPropagation(); e.preventDefault(); if (e.currentTarget.animationName.includes('slide-from')) { setStatus('active'); } else if (e.currentTarget.animationName.includes('slide-to')) { setStatus('inactive'); } }); return ( {children} ); }