Files
ServerKit/frontend/src/components/Modal.jsx
T
Juan Denis fea0698f3e UI: revamp dialogs, badges, and alerts tab
Add dev toggle for IPC auth and fix CORS Authorization header; introduce SERVERKIT_IPC_NO_AUTH to skip bearer checks in dev and log a warning. Frontend: wide UI refactor — convert Sheet-based modals to Dialogs, restyle ConfirmDialog, update Badge and Button variants (sizes, rounded tokens, data attributes), improve Tabs overflow trigger handling, and add ARIA labels for process action buttons. Docker page: unify/normalize ports formatting for multiple agent shapes and render safely. ServerDetail: add Alerts tab, load and manage security alerts (acknowledge/resolve), and restructure overview into KPI tiles, info rows, and SystemStatusCard. Replace several ad-hoc modals in Cron/Cloudflared with Dialog + Select forms and tidy Settings/agent sections. Also add UI_REPORT.md to .gitignore.
2026-05-02 03:20:07 -04:00

56 lines
1.2 KiB
React

import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
DialogFooter,
} from '@/components/ui/dialog';
import { cn } from '@/lib/utils';
// Size → Tailwind max-width on >=sm screens. Mobile is always nearly full-width.
const SIZE_CLASS = {
sm: 'sm:max-w-sm',
md: 'sm:max-w-lg',
lg: 'sm:max-w-2xl',
xl: 'sm:max-w-4xl',
'2xl': 'sm:max-w-6xl',
};
export default function Modal({
open,
onClose,
title,
children,
footer,
className = '',
size = 'md',
}) {
const sizeClass = SIZE_CLASS[size] || SIZE_CLASS.md;
return (
<Dialog open={open} onOpenChange={(v) => !v && onClose()}>
<DialogContent
className={cn(
'max-h-[90vh] overflow-hidden p-0 flex flex-col gap-0',
sizeClass,
className
)}
>
{title && (
<DialogHeader className="px-6 py-4 pr-12 border-b border-border space-y-0">
<DialogTitle>{title}</DialogTitle>
</DialogHeader>
)}
<div className="flex-1 overflow-y-auto px-6 py-4">{children}</div>
{footer && (
<DialogFooter className="px-6 py-3 border-t border-border bg-card sm:justify-end">
{footer}
</DialogFooter>
)}
</DialogContent>
</Dialog>
);
}