tianji/src/client/components/CommonWrapper.tsx

23 lines
579 B
TypeScript
Raw Normal View History

2024-03-23 11:38:39 +00:00
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">
<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';