Skip to content

Commit

Permalink
wistia player playground component
Browse files Browse the repository at this point in the history
  • Loading branch information
philipstubbs13 committed Aug 1, 2024
1 parent 564bcbd commit f365e29
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
13 changes: 5 additions & 8 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
"use client";

import { WistiaVideoPlayer } from "@/components/wistia-video-player/WistiaVideoPlayer";
import { WistiaVideoPlayground } from "@/components/wistia-video-playground/WistiaVideoPlayground";
import Link from "next/link";
import { useSearchParams } from "next/navigation";
import { Suspense } from "react";

export default function Home() {
const searchParams = useSearchParams();
const videoId = searchParams.get("videoId") || "hb26s9rudm";

return (
<main>
<div className="w-full max-w-5xl mx-auto py-12 px-4 md:px-6">
Expand Down Expand Up @@ -43,7 +38,9 @@ export default function Home() {
Storybook
</Link>
</div>
{videoId && <WistiaVideoPlayer videoId={videoId} />}
<Suspense fallback={"Loading..."}>
<WistiaVideoPlayground />
</Suspense>
</div>
</div>
</main>
Expand Down
11 changes: 11 additions & 0 deletions components/wistia-video-playground/WistiaVideoPlayground.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"use client";

import { WistiaVideoPlayer } from "@/components/wistia-video-player/WistiaVideoPlayer";
import { useSearchParams } from "next/navigation";

export const WistiaVideoPlayground = () => {
const searchParams = useSearchParams();
const videoId = searchParams.get("videoId") || "hb26s9rudm";

return <WistiaVideoPlayer videoId={videoId} />;
};

0 comments on commit f365e29

Please sign in to comment.