import { useState } from 'react'; import { Dialog, DialogContent } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { Card } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { X, ArrowsClockwise } from '@phosphor-icons/react'; interface PreviewModalProps { open: boolean; onClose: () => void; code: string; } interface SharedState { variable: string; roblox: string; web: string; mobile: string; status: 'synced' | 'syncing' | 'conflict'; } export function PreviewModal({ open, onClose, code }: PreviewModalProps) { const [sharedState] = useState([ { variable: 'playerX', roblox: '120', web: '120', mobile: '120', status: 'synced' }, { variable: 'playerY', roblox: '50', web: '50', mobile: '50', status: 'synced' }, { variable: 'health', roblox: '100', web: '98', mobile: '100', status: 'syncing' }, { variable: 'score', roblox: '450', web: '450', mobile: '450', status: 'synced' }, ]); const getStatusColor = (status: SharedState['status']) => { switch (status) { case 'synced': return 'text-green-500'; case 'syncing': return 'text-yellow-500'; case 'conflict': return 'text-red-500'; } }; const getStatusIcon = (status: SharedState['status']) => { switch (status) { case 'synced': return '✓'; case 'syncing': return '⚠'; case 'conflict': return '✗'; } }; return (

Preview - All Platforms

All Platforms Roblox Web Mobile

Roblox

🎮

Roblox Viewport

Studio integration

Web Browser

🌐

Web Canvas

Browser preview

Mobile

📱

Mobile View

Shared State Sync

Live Sync Enabled
{sharedState.map((state, idx) => ( ))}
Variable Roblox Web Mobile Status
{state.variable} {state.roblox} {state.web} {state.mobile} {getStatusIcon(state.status)} {state.status}
🎮

Roblox Preview

Full-screen Roblox viewport

🌐

Web Preview

Browser-based game preview

📱

Mobile Preview

iOS/Android view

); }