tianji/src/client/components/CommonWrapper.tsx

25 lines
623 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">
2024-03-25 13:53:43 +00:00
{props.header && (
<div className="flex h-[52px] items-center px-4 py-2">
{props.header}
</div>
)}
2024-03-23 11:38:39 +00:00
<Separator />
<div className="flex-1 overflow-hidden">{props.children}</div>
</div>
);
}
);
CommonWrapper.displayName = 'CommonWrapper';