mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 11:25:52 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
25 lines
855 B
TypeScript
25 lines
855 B
TypeScript
import React from 'react';
|
|
import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
|
|
import { cn } from '@/lib/cn';
|
|
import { sectionTitleClass } from '@/components/ui/typography';
|
|
|
|
type Props = Readonly<
|
|
React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> & {
|
|
title?: string;
|
|
borderColor?: string;
|
|
showLoadingOverlay?: boolean;
|
|
}
|
|
>;
|
|
|
|
const ContentBox = ({ title, borderColor, showLoadingOverlay, children, ...props }: Props) => (
|
|
<div {...props}>
|
|
{title && <h2 className={cn(sectionTitleClass, 'mb-4 px-4')}>{title}</h2>}
|
|
<div className={cn('bg-card p-4 rounded-sm shadow-lg relative', !!borderColor && 'border-t-4')}>
|
|
<SpinnerOverlay visible={showLoadingOverlay || false} />
|
|
{children}
|
|
</div>
|
|
</div>
|
|
);
|
|
|
|
export default ContentBox;
|