Files
e-tib.com/components/AnnotatorClientWrapper.tsx
Marc Mintel 38a870bea8
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 38s
Build & Deploy / 🧪 QA (push) Failing after 36s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 3s
feat: integrate mintel annotator with email submission and environment restrictions
2026-06-19 15:13:07 +02:00

31 lines
948 B
TypeScript

'use client';
import { Annotator } from '@mintel/annotator';
import { useEffect, useState } from 'react';
import { getAnnotatorAssets } from '@/app/actions/getAnnotatorAssets';
import { submitAnnotations } from '@/app/actions/submitAnnotations';
export default function AnnotatorClientWrapper() {
const [assets, setAssets] = useState<string[]>([]);
useEffect(() => {
getAnnotatorAssets().then(fetchedAssets => {
console.log('[AnnotatorClientWrapper] fetchedAssets:', fetchedAssets);
if (Array.isArray(fetchedAssets)) {
setAssets(fetchedAssets);
}
}).catch(err => {
console.error('[AnnotatorClientWrapper] Action failed:', err);
});
}, []);
const handleSubmit = async (annotations: any[]) => {
const result = await submitAnnotations(annotations);
if (!result.success) {
throw new Error(result.error);
}
};
return <Annotator assets={assets} onSubmit={handleSubmit} />;
}