import React from "react"; import { Typography } from "antd"; import useRoute from "@/routes/hooks/useRoute"; import { useTranslation } from "react-i18next"; const pageStyle = { margin: "0 24px 24px 24px", // margin: '24px', minHeight: "calc(100% - 24px)", }; const { Title } = Typography; export default (props) => { const router = useRoute() || {}; const style = router.meta.noLayout ? { height: "100%" } : pageStyle; const title = props.title || router.meta.title; const { t } = useTranslation(); return (
{title && !router.meta.noLayout && ( {t(`${router.path}.title`)} )} {props.children}
); };