Files
pterodactyl-panel/resources/scripts/components/elements/ContentBox.tsx
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

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;