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/zoom/ServerSyllable.tsx | 84 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 src/zoom/ServerSyllable.tsx (limited to 'src/zoom/ServerSyllable.tsx') diff --git a/src/zoom/ServerSyllable.tsx b/src/zoom/ServerSyllable.tsx new file mode 100644 index 0000000..907b956 --- /dev/null +++ b/src/zoom/ServerSyllable.tsx @@ -0,0 +1,84 @@ +// This is a Server Component +import React, { Suspense } from "react"; +import db from "@/lib/db"; +import { + Card, + CardHeader, + CardDescription, + CardContent, + CardFooter, + CardTitle, +} from "@/components/ui/card"; +import { NLP } from "sortug-ai"; +import { Volume2, Link as LinkIcon } from "lucide-react"; +import { isTonal } from "@/lib/lang/utils"; +import { CardResponse, SyllableToken } from "@/lib/types/cards"; +import { deconstructSyllable } from "@/lib/calls/nlp"; + +export default async function (props: { data: CardResponse }) { + const { expression } = props.data; + const { result } = await deconstructSyllable(expression.spelling); + + return ( +
+

+ {expression.spelling} +

+ }> + + +
+ ); +} + +function Deconstructed({ syl }: { syl: SyllableToken[] }) { + return ( +
+ {syl.map((tok) => ( + + ))} +
+ ); +} + +// Helper component for IPA display +const IpaDisplay = ({ + ipaEntries, +}: { + ipaEntries: Array<{ ipa: string; tags?: string[] }>; +}) => { + if (!ipaEntries || ipaEntries.length === 0) return null; + return ( +
+ {ipaEntries.map((entry, index) => { + const tags = entry.tags ? entry.tags : []; + return ( + + {entry.ipa}{" "} + {tags.length > 0 && ( + ({tags.join(", ")}) + )} + + ); + })} + +
+ ); +}; + +function Tones({ text, lang }: WordProps) { + return
; +} +function NotTones({ text, lang }: WordProps) { + return
; +} -- cgit v1.2.3