Files
cunkebao_v3/nkebao/src/components/Layout/Layout.tsx
笔记本里的永平 b1938a76c0 feat: 本次提交更新内容如下
梳理了icon ,增加了layout的loading
2025-07-19 16:10:26 +08:00

37 lines
826 B
TypeScript

import React from "react";
import { SpinLoading } from "antd-mobile";
import styles from "./layout.module.scss";
interface LayoutProps {
loading?: boolean;
children?: React.ReactNode;
header?: React.ReactNode;
footer?: React.ReactNode;
}
const Layout: React.FC<LayoutProps> = ({
children,
header,
footer,
loading = false,
}) => {
return (
<div className={styles.container}>
{header && <header>{header}</header>}
<main>
{loading ? (
<div className={styles.loadingContainer}>
<SpinLoading color="primary" style={{ fontSize: 32 }} />
<div className={styles.loadingText}>...</div>
</div>
) : (
children
)}
</main>
{footer && <footer>{footer}</footer>}
</div>
);
};
export default Layout;