|
1 | 1 | import { createRoot } from 'react-dom/client' |
| 2 | +import { useState } from 'react' |
2 | 3 | import '@/entrypoints/popup/style.css' |
3 | 4 | import './style.css' |
4 | | -import { PopupPlayground } from './PopupPlayground' |
| 5 | +import { Replica } from './replica' |
| 6 | +import { ClaudePrototype } from "./claude" |
5 | 7 |
|
6 | | -const root = createRoot(document.getElementById('root')!) |
7 | | -root.render( |
8 | | - <div className='min-h-screen bg-slate-100'> |
9 | | - <div className='container px-6 py-8'> |
10 | | - <div className='bg-white p-6 rounded-lg shadow-sm border border-slate-200 mb-6'> |
11 | | - <h1 className='text-2xl font-bold text-slate-900 mb-2'>Popup Simulator</h1> |
12 | | - </div> |
| 8 | +type Mode = 'Replica' | 'ClaudePrototype' |
13 | 9 |
|
14 | | - <div className='popup-frame'> |
15 | | - <PopupPlayground /> |
16 | | - </div> |
| 10 | +const App = () => { |
| 11 | + const [activeComponent, setActiveComponent] = useState<Mode>('Replica') |
17 | 12 |
|
18 | | - <div className='bg-slate-50 p-4 rounded-lg border border-slate-200 mt-6 max-w-2xl mx-auto'> |
19 | | - <h3 className='font-medium text-slate-900 mb-2'>Development Notes</h3> |
20 | | - <ul className='text-sm text-slate-600 space-y-1'> |
21 | | - <li>The popup frame above matches the exact browser extension popup.</li> |
22 | | - <li>Hot reload is active for instant updates</li> |
23 | | - </ul> |
| 13 | + return ( |
| 14 | + <div className='min-h-screen bg-slate-100'> |
| 15 | + <div className='container px-6 py-8'> |
| 16 | + <div className='bg-white p-6 rounded-lg shadow-sm border border-slate-200 mb-6'> |
| 17 | + <h1 className='text-2xl font-bold text-slate-900 mb-2'>Popup Simulator</h1> |
| 18 | + <ul className='text-sm text-slate-600 space-y-1'> |
| 19 | + <li>The popup frame is meant to exactly match the browser extension popup.</li> |
| 20 | + <li>Hot reload is active for instant updates</li> |
| 21 | + </ul> |
| 22 | + <div className='flex gap-2 mt-4'> |
| 23 | + <button |
| 24 | + onClick={() => setActiveComponent('Replica')} |
| 25 | + className={`px-3 py-2 rounded text-sm font-medium transition-colors ${activeComponent === 'Replica' |
| 26 | + ? 'bg-blue-600 text-white' |
| 27 | + : 'bg-gray-100 text-gray-700 hover:bg-gray-200' |
| 28 | + }`} |
| 29 | + > |
| 30 | + Replica |
| 31 | + </button> |
| 32 | + <button |
| 33 | + onClick={() => setActiveComponent('ClaudePrototype')} |
| 34 | + className={`px-3 py-2 rounded text-sm font-medium transition-colors ${activeComponent === 'ClaudePrototype' |
| 35 | + ? 'bg-blue-600 text-white' |
| 36 | + : 'bg-gray-100 text-gray-700 hover:bg-gray-200' |
| 37 | + }`} |
| 38 | + > |
| 39 | + ClaudePrototype |
| 40 | + </button> |
| 41 | + </div> |
| 42 | + </div> |
| 43 | + |
| 44 | + <div className='popup-frame'> |
| 45 | + {activeComponent === 'Replica' && <Replica />} |
| 46 | + {activeComponent === 'ClaudePrototype' && <ClaudePrototype />} |
| 47 | + </div> |
24 | 48 | </div> |
25 | 49 | </div> |
26 | | - </div>, |
27 | | -) |
| 50 | + ) |
| 51 | +} |
| 52 | + |
| 53 | +const root = createRoot(document.getElementById('root')!) |
| 54 | +root.render(<App />) |
0 commit comments