Files
tashow-h5/src/component/xpopup/index.tsx
2025-09-03 15:06:16 +08:00

29 lines
739 B
TypeScript

import { Divider, Popup } from "antd-mobile";
import { CloseOutline } from "antd-mobile-icons";
import "./index.less";
interface DefinedProps {
visible: boolean;
title: string;
children: React.ReactNode;
onClose: () => void;
}
function XPopup(props: DefinedProps) {
const { visible, title, children, onClose } = props;
return (
<Popup visible={visible} closeOnMaskClick={true} className="xpopup">
<div className="header">
<h3 className="title">{title}</h3>
<span className="closeIcon" onClick={onClose}>
<CloseOutline style={{ fontSize: "16px" }} />
</span>
</div>
<Divider />
<div className="content">{children}</div>
</Popup>
);
}
export default XPopup;