2026-02-01 20:55:39 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
|
|
|
import { cn } from '@/lib/utils';
|
|
|
|
|
import { SettingsView } from './SettingsView';
|
|
|
|
|
|
|
|
|
|
interface SettingsWindowProps {
|
|
|
|
|
open: boolean;
|
|
|
|
|
onOpenChange: (open: boolean) => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Settings rendered as a centered window with blurred backdrop.
|
|
|
|
|
* Used for desktop and web (non-mobile) environments.
|
|
|
|
|
*/
|
|
|
|
|
export const SettingsWindow: React.FC<SettingsWindowProps> = ({ open, onOpenChange }) => {
|
2026-02-04 01:13:23 -08:00
|
|
|
const descriptionId = React.useId();
|
2026-02-01 20:55:39 +02:00
|
|
|
return (
|
|
|
|
|
<DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>
|
|
|
|
|
<DialogPrimitive.Portal>
|
|
|
|
|
<DialogPrimitive.Overlay
|
|
|
|
|
className="fixed inset-0 z-50 bg-black/50 backdrop-blur-md"
|
|
|
|
|
/>
|
|
|
|
|
<DialogPrimitive.Content
|
2026-02-04 01:13:23 -08:00
|
|
|
aria-describedby={descriptionId}
|
2026-02-01 20:55:39 +02:00
|
|
|
className={cn(
|
|
|
|
|
'fixed z-50 top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%]',
|
2026-02-24 03:28:30 +02:00
|
|
|
'w-[90vw] max-w-[960px] h-[85vh] max-h-[900px]',
|
2026-02-01 20:55:39 +02:00
|
|
|
'rounded-xl border shadow-2xl overflow-hidden',
|
|
|
|
|
'bg-background'
|
|
|
|
|
)}
|
|
|
|
|
>
|
2026-02-04 01:13:23 -08:00
|
|
|
<DialogPrimitive.Description id={descriptionId} className="sr-only">
|
|
|
|
|
OpenChamber settings window.
|
|
|
|
|
</DialogPrimitive.Description>
|
2026-02-01 20:55:39 +02:00
|
|
|
<SettingsView onClose={() => onOpenChange(false)} isWindowed />
|
|
|
|
|
</DialogPrimitive.Content>
|
|
|
|
|
</DialogPrimitive.Portal>
|
|
|
|
|
</DialogPrimitive.Root>
|
|
|
|
|
);
|
|
|
|
|
};
|