Skip to content

Commit

Permalink
Merge pull request #12 from jtoy/static-export-for-rails
Browse files Browse the repository at this point in the history
mystery machine
  • Loading branch information
jtoy authored Feb 21, 2024
2 parents 1463571 + ee48efe commit ea4e488
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions web/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use client';

import React, { useEffect, useState } from 'react';
import RenderLevel from '@/components/RenderLevel';

export default function Page() {
const [simId, setSimId] = useState<string | null>(null);

useEffect(() => {
const params = new URLSearchParams(window.location.search);
const sim_id = params.get('sim_id');
if (sim_id) {
setSimId(sim_id);
}
}, []);

if (!simId) {
return null;
}

return <RenderLevel simId={simId} />;
}

0 comments on commit ea4e488

Please sign in to comment.