From a3f24ea79b14394b24c4b60a010651eb29eeb872 Mon Sep 17 00:00:00 2001 From: polwex Date: Thu, 29 May 2025 12:10:22 +0700 Subject: glorious new db --- src/pages/tones.tsx | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/pages/tones.tsx (limited to 'src/pages/tones.tsx') diff --git a/src/pages/tones.tsx b/src/pages/tones.tsx new file mode 100644 index 0000000..1a1e908 --- /dev/null +++ b/src/pages/tones.tsx @@ -0,0 +1,62 @@ +import { Suspense } from 'react'; +import { fetchWordsByToneAndSyllables } from '@/actions/tones'; +import ToneSelectorClient from '@/components/tones/ToneSelectorClient'; +import { Skeleton } from '@/components/ui/skeleton'; // For Suspense fallback + +export const getConfig = async () => { + return { + render: 'static', // Or 'dynamic' if you prefer SSR for every request + }; +}; + +// Function to fetch the initial word on the server +async function InitialWordLoader() { + // Fetch a random 1-syllable Thai word with any tone initially + const initialWord = await fetchWordsByToneAndSyllables(1, [null]); + return ; +} + +// Loading fallback component +function TonePageSkeleton() { + return ( +
+
+ + + +
+
+ + +
+
+ + +
+
+ +
+
+ + + +
+
+ ); +} + + +export default function TonesPage() { + return ( +
+ }> + + +
+ ); +} + +export const metadata = { + title: 'Thai Tone Explorer', + description: 'Explore Thai words by syllable count and tones.', +}; -- cgit v1.2.3