import { getSurfaceName, SURFACES } from './lib/surface.js';
import { DesktopSurface } from './surfaces/DesktopSurface.jsx';
import { LauncherSurface } from './surfaces/LauncherSurface.jsx';
import { PreviewSurface } from './surfaces/PreviewSurface.jsx';
import { TopBarSurface } from './surfaces/TopBarSurface.jsx';

const SURFACE_VIEWS = {
  [SURFACES.DESKTOP]: DesktopSurface,
  [SURFACES.TOPBAR]: TopBarSurface,
  [SURFACES.LAUNCHER]: LauncherSurface,
  [SURFACES.PREVIEW]: PreviewSurface,
};

export default function App() {
  const surface = getSurfaceName();
  const View = SURFACE_VIEWS[surface] ?? PreviewSurface;
  return <View />;
}
