interactives/src/pages/BulgarianSolitairePage.tsx
gpt-engineer-app[bot] cb484c418e Add Bulgarian Solitaire interactive
Create a new interactive component for Bulgarian Solitaire. This component will allow users to select a number `n` (2-6), visualize a container with `1+2+...+n` boxes, and arrange these boxes into `1+2+...+n` columns. Users can drag and drop boxes between columns and return them to the container by double-clicking. A "Play" button will initiate the simulation of the Bulgarian Solitaire process until a steady state is reached. This interactive will be added to the Puzzles section.
2025-08-21 11:16:49 +00:00

29 lines
No EOL
898 B
TypeScript

import BulgarianSolitaire from "@/components/BulgarianSolitaire";
import { useSearchParams } from "react-router-dom";
const BulgarianSolitairePage = () => {
const [searchParams] = useSearchParams();
const from = searchParams.get('from');
if (from === 'puzzles') {
return (
<div className="min-h-screen bg-background">
<div className="container mx-auto px-4 py-8 space-y-6">
<div className="flex items-center gap-4">
<button
onClick={() => window.location.href = '/themes/puzzles'}
className="text-primary hover:text-primary/80 font-medium"
>
Back to Puzzles
</button>
</div>
<BulgarianSolitaire showSocialShare={true} />
</div>
</div>
);
}
return <BulgarianSolitaire showSocialShare={true} />;
};
export default BulgarianSolitairePage;