tianji/src/client/components/CommonWrapper.tsx
2024-04-07 19:43:05 +08:00

25 lines
623 B
TypeScript

import React from 'react';
import { Separator } from './ui/separator';
interface CommonWrapperProps extends React.PropsWithChildren {
header?: React.ReactNode;
}
export const CommonWrapper: React.FC<CommonWrapperProps> = React.memo(
(props) => {
return (
<div className="flex h-full flex-col">
{props.header && (
<div className="flex h-[52px] items-center px-4 py-2">
{props.header}
</div>
)}
<Separator />
<div className="flex-1 overflow-hidden">{props.children}</div>
</div>
);
}
);
CommonWrapper.displayName = 'CommonWrapper';