// 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
; }