mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 06:53:44 +08:00
37 lines
996 B
TypeScript
37 lines
996 B
TypeScript
import React, { ReactNode } from "react";
|
|
import { Typography } from "@mui/material";
|
|
import { BaseErrorBoundary } from "./base-error-boundary";
|
|
|
|
interface Props {
|
|
title?: React.ReactNode; // the page title
|
|
header?: React.ReactNode; // something behind title
|
|
contentStyle?: React.CSSProperties;
|
|
children?: ReactNode;
|
|
}
|
|
|
|
export const BasePage: React.FC<Props> = (props) => {
|
|
const { title, header, contentStyle, children } = props;
|
|
|
|
return (
|
|
<BaseErrorBoundary>
|
|
<div className="base-page" data-windrag>
|
|
<header data-windrag style={{ userSelect: "none" }}>
|
|
<Typography variant="h4" component="h1" data-windrag>
|
|
{title}
|
|
</Typography>
|
|
|
|
{header}
|
|
</header>
|
|
|
|
<div className="base-container">
|
|
<section>
|
|
<div className="base-content" style={contentStyle} data-windrag>
|
|
{children}
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</BaseErrorBoundary>
|
|
);
|
|
};
|