{t('location')}
-{reference.frontmatter.location}
-{t('client')}
-{reference.frontmatter.client}
-{t('period')}
-{reference.frontmatter.dateString || new Date(reference.frontmatter.date).getFullYear()}
-Es wurden neue Korrekturen über den Annotator eingereicht.
+${ann.selector}Die genauen Daten (inkl. Scroll-Positionen, Viewport und Zeitstempel) befinden sich im JSON-Anhang.
+ `; + + const notificationResult = await sendEmail({ + replyTo: 'info@e-tib.com', // Falls Rückfragen nötig + subject: `[Korrekturen] ${annotations.length} neue Anmerkungen für E-TIB`, + html: htmlContent, + attachments: [ + { + filename: 'corrections.json', + content: jsonContent, + contentType: 'application/json', + } + ] + }); + + if (!notificationResult.success) { + logger.error('Annotation email FAILED', { error: notificationResult.error }); + return { success: false, error: notificationResult.error }; + } + + logger.info('Annotation email sent successfully', { count: annotations.length }); + return { success: true }; + } catch (error) { + const errorMsg = error instanceof Error ? error.message : String(error); + logger.error('Failed to send annotations', { error: errorMsg }); + return { success: false, error: errorMsg }; + } +} diff --git a/components/AnnotatorClientWrapper.tsx b/components/AnnotatorClientWrapper.tsx new file mode 100644 index 000000000..26a7957ca --- /dev/null +++ b/components/AnnotatorClientWrapper.tsx @@ -0,0 +1,30 @@ +'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