"use server"; import db from "../lib/db"; import { analyzeTHWord, segmentateThai } from "@/lib/calls/nlp"; export function shuffleDeck(userId: number, lessonId: number) { const res = db.fetchLesson({ userId, lessonId, random: true }); return res; } export async function thaiAnalysis(text: string) { const res = await segmentateThai(text); const res2 = await analyzeTHWord(text); console.log({ res, res2 }); } export async function toggleBookmark( userId: number, wordId: number, is: boolean, notes?: string, ) { console.log("toggling on server, ostensibly"); const r = !is ? db.addBookmark(userId, wordId, notes) : db.delBookmark(userId, wordId); return { ok: "ack" }; } // export async function ocrAction(file: File): AsyncRes { // const res = await NLP.ocr(file); // return res; // }