mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-24 01:16:42 +02:00
♻️ refactor: unify web app patterns across monorepo
- Rename authStore.svelte.ts to auth.svelte.ts (manacore, manadeck, moodlit) - Add i18n setup to Finance and Mail apps (DE, EN, FR, ES, IT) - Add feedback pages using shared component to Finance and Mail - Create @manacore/shared-api-client package with API client factory - Create @manacore/shared-vite-config package with SSR config helpers - Create @manacore/shared-stores package with toast, navigation, theme factories 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
c93aca0cce
commit
cfbc8a2c15
60 changed files with 2213 additions and 173 deletions
58
apps/mail/apps/web/src/lib/i18n/index.ts
Normal file
58
apps/mail/apps/web/src/lib/i18n/index.ts
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/**
|
||||
* i18n setup for Mail app
|
||||
* Supports: DE, EN, FR, ES, IT
|
||||
*/
|
||||
|
||||
import { browser } from '$app/environment';
|
||||
import { init, register, locale, getLocaleFromNavigator } from 'svelte-i18n';
|
||||
|
||||
// Supported locales
|
||||
export const supportedLocales = ['de', 'en', 'fr', 'es', 'it'] as const;
|
||||
export type SupportedLocale = (typeof supportedLocales)[number];
|
||||
|
||||
// Register locales
|
||||
register('de', () => import('./locales/de.json'));
|
||||
register('en', () => import('./locales/en.json'));
|
||||
register('fr', () => import('./locales/fr.json'));
|
||||
register('es', () => import('./locales/es.json'));
|
||||
register('it', () => import('./locales/it.json'));
|
||||
|
||||
// Get initial locale
|
||||
function getInitialLocale(): SupportedLocale {
|
||||
if (browser) {
|
||||
// Check localStorage first
|
||||
const saved = localStorage.getItem('mail-locale');
|
||||
if (saved && supportedLocales.includes(saved as SupportedLocale)) {
|
||||
return saved as SupportedLocale;
|
||||
}
|
||||
|
||||
// Fall back to browser language
|
||||
const browserLocale = getLocaleFromNavigator();
|
||||
if (browserLocale) {
|
||||
const shortLocale = browserLocale.split('-')[0] as SupportedLocale;
|
||||
if (supportedLocales.includes(shortLocale)) {
|
||||
return shortLocale;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Default to German
|
||||
return 'de';
|
||||
}
|
||||
|
||||
// Initialize i18n at module scope (required for SSR)
|
||||
init({
|
||||
fallbackLocale: 'de',
|
||||
initialLocale: getInitialLocale(),
|
||||
});
|
||||
|
||||
// Set locale and persist
|
||||
export function setLocale(newLocale: SupportedLocale) {
|
||||
locale.set(newLocale);
|
||||
if (browser) {
|
||||
localStorage.setItem('mail-locale', newLocale);
|
||||
}
|
||||
}
|
||||
|
||||
// Wait for locale to be loaded (useful for SSR)
|
||||
export { waitLocale } from 'svelte-i18n';
|
||||
105
apps/mail/apps/web/src/lib/i18n/locales/de.json
Normal file
105
apps/mail/apps/web/src/lib/i18n/locales/de.json
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
{
|
||||
"app": {
|
||||
"name": "Mail",
|
||||
"loading": "Laden..."
|
||||
},
|
||||
"nav": {
|
||||
"inbox": "Posteingang",
|
||||
"sent": "Gesendet",
|
||||
"drafts": "Entwürfe",
|
||||
"starred": "Markiert",
|
||||
"archive": "Archiv",
|
||||
"trash": "Papierkorb",
|
||||
"spam": "Spam",
|
||||
"settings": "Einstellungen",
|
||||
"feedback": "Feedback"
|
||||
},
|
||||
"auth": {
|
||||
"login": "Anmelden",
|
||||
"register": "Registrieren",
|
||||
"logout": "Abmelden",
|
||||
"forgotPassword": "Passwort vergessen",
|
||||
"email": "E-Mail",
|
||||
"password": "Passwort",
|
||||
"confirmPassword": "Passwort bestätigen"
|
||||
},
|
||||
"email": {
|
||||
"compose": "Neue E-Mail",
|
||||
"reply": "Antworten",
|
||||
"replyAll": "Allen antworten",
|
||||
"forward": "Weiterleiten",
|
||||
"delete": "Löschen",
|
||||
"archive": "Archivieren",
|
||||
"markRead": "Als gelesen markieren",
|
||||
"markUnread": "Als ungelesen markieren",
|
||||
"star": "Mit Stern markieren",
|
||||
"unstar": "Stern entfernen",
|
||||
"to": "An",
|
||||
"cc": "CC",
|
||||
"bcc": "BCC",
|
||||
"subject": "Betreff",
|
||||
"body": "Nachricht",
|
||||
"send": "Senden",
|
||||
"saveDraft": "Als Entwurf speichern",
|
||||
"discard": "Verwerfen",
|
||||
"attachments": "Anhänge",
|
||||
"addAttachment": "Anhang hinzufügen",
|
||||
"noEmails": "Keine E-Mails",
|
||||
"noSubject": "(Kein Betreff)",
|
||||
"from": "Von",
|
||||
"date": "Datum"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Ordner",
|
||||
"add": "Ordner hinzufügen",
|
||||
"edit": "Ordner bearbeiten",
|
||||
"delete": "Ordner löschen",
|
||||
"name": "Ordnername"
|
||||
},
|
||||
"labels": {
|
||||
"title": "Labels",
|
||||
"add": "Label hinzufügen",
|
||||
"edit": "Label bearbeiten",
|
||||
"delete": "Label löschen",
|
||||
"name": "Labelname",
|
||||
"color": "Farbe"
|
||||
},
|
||||
"accounts": {
|
||||
"title": "E-Mail-Konten",
|
||||
"add": "Konto hinzufügen",
|
||||
"edit": "Konto bearbeiten",
|
||||
"delete": "Konto löschen",
|
||||
"name": "Kontoname",
|
||||
"address": "E-Mail-Adresse",
|
||||
"default": "Standardkonto"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Einstellungen",
|
||||
"general": "Allgemein",
|
||||
"appearance": "Darstellung",
|
||||
"accounts": "Konten",
|
||||
"signature": "Signatur",
|
||||
"language": "Sprache",
|
||||
"theme": "Design",
|
||||
"darkMode": "Dunkelmodus",
|
||||
"notifications": "Benachrichtigungen"
|
||||
},
|
||||
"common": {
|
||||
"save": "Speichern",
|
||||
"cancel": "Abbrechen",
|
||||
"delete": "Löschen",
|
||||
"edit": "Bearbeiten",
|
||||
"add": "Hinzufügen",
|
||||
"confirm": "Bestätigen",
|
||||
"yes": "Ja",
|
||||
"no": "Nein",
|
||||
"ok": "OK",
|
||||
"loading": "Laden...",
|
||||
"error": "Fehler",
|
||||
"success": "Erfolg",
|
||||
"back": "Zurück",
|
||||
"search": "Suchen",
|
||||
"select": "Auswählen",
|
||||
"selectAll": "Alle auswählen"
|
||||
}
|
||||
}
|
||||
105
apps/mail/apps/web/src/lib/i18n/locales/en.json
Normal file
105
apps/mail/apps/web/src/lib/i18n/locales/en.json
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
{
|
||||
"app": {
|
||||
"name": "Mail",
|
||||
"loading": "Loading..."
|
||||
},
|
||||
"nav": {
|
||||
"inbox": "Inbox",
|
||||
"sent": "Sent",
|
||||
"drafts": "Drafts",
|
||||
"starred": "Starred",
|
||||
"archive": "Archive",
|
||||
"trash": "Trash",
|
||||
"spam": "Spam",
|
||||
"settings": "Settings",
|
||||
"feedback": "Feedback"
|
||||
},
|
||||
"auth": {
|
||||
"login": "Sign In",
|
||||
"register": "Sign Up",
|
||||
"logout": "Sign Out",
|
||||
"forgotPassword": "Forgot Password",
|
||||
"email": "Email",
|
||||
"password": "Password",
|
||||
"confirmPassword": "Confirm Password"
|
||||
},
|
||||
"email": {
|
||||
"compose": "Compose",
|
||||
"reply": "Reply",
|
||||
"replyAll": "Reply All",
|
||||
"forward": "Forward",
|
||||
"delete": "Delete",
|
||||
"archive": "Archive",
|
||||
"markRead": "Mark as read",
|
||||
"markUnread": "Mark as unread",
|
||||
"star": "Star",
|
||||
"unstar": "Unstar",
|
||||
"to": "To",
|
||||
"cc": "CC",
|
||||
"bcc": "BCC",
|
||||
"subject": "Subject",
|
||||
"body": "Message",
|
||||
"send": "Send",
|
||||
"saveDraft": "Save as draft",
|
||||
"discard": "Discard",
|
||||
"attachments": "Attachments",
|
||||
"addAttachment": "Add attachment",
|
||||
"noEmails": "No emails",
|
||||
"noSubject": "(No subject)",
|
||||
"from": "From",
|
||||
"date": "Date"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Folders",
|
||||
"add": "Add Folder",
|
||||
"edit": "Edit Folder",
|
||||
"delete": "Delete Folder",
|
||||
"name": "Folder name"
|
||||
},
|
||||
"labels": {
|
||||
"title": "Labels",
|
||||
"add": "Add Label",
|
||||
"edit": "Edit Label",
|
||||
"delete": "Delete Label",
|
||||
"name": "Label name",
|
||||
"color": "Color"
|
||||
},
|
||||
"accounts": {
|
||||
"title": "Email Accounts",
|
||||
"add": "Add Account",
|
||||
"edit": "Edit Account",
|
||||
"delete": "Delete Account",
|
||||
"name": "Account name",
|
||||
"address": "Email address",
|
||||
"default": "Default account"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Settings",
|
||||
"general": "General",
|
||||
"appearance": "Appearance",
|
||||
"accounts": "Accounts",
|
||||
"signature": "Signature",
|
||||
"language": "Language",
|
||||
"theme": "Theme",
|
||||
"darkMode": "Dark Mode",
|
||||
"notifications": "Notifications"
|
||||
},
|
||||
"common": {
|
||||
"save": "Save",
|
||||
"cancel": "Cancel",
|
||||
"delete": "Delete",
|
||||
"edit": "Edit",
|
||||
"add": "Add",
|
||||
"confirm": "Confirm",
|
||||
"yes": "Yes",
|
||||
"no": "No",
|
||||
"ok": "OK",
|
||||
"loading": "Loading...",
|
||||
"error": "Error",
|
||||
"success": "Success",
|
||||
"back": "Back",
|
||||
"search": "Search",
|
||||
"select": "Select",
|
||||
"selectAll": "Select all"
|
||||
}
|
||||
}
|
||||
105
apps/mail/apps/web/src/lib/i18n/locales/es.json
Normal file
105
apps/mail/apps/web/src/lib/i18n/locales/es.json
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
{
|
||||
"app": {
|
||||
"name": "Mail",
|
||||
"loading": "Cargando..."
|
||||
},
|
||||
"nav": {
|
||||
"inbox": "Bandeja de entrada",
|
||||
"sent": "Enviados",
|
||||
"drafts": "Borradores",
|
||||
"starred": "Destacados",
|
||||
"archive": "Archivo",
|
||||
"trash": "Papelera",
|
||||
"spam": "Spam",
|
||||
"settings": "Configuración",
|
||||
"feedback": "Feedback"
|
||||
},
|
||||
"auth": {
|
||||
"login": "Iniciar sesión",
|
||||
"register": "Registrarse",
|
||||
"logout": "Cerrar sesión",
|
||||
"forgotPassword": "Olvidé mi contraseña",
|
||||
"email": "Correo electrónico",
|
||||
"password": "Contraseña",
|
||||
"confirmPassword": "Confirmar contraseña"
|
||||
},
|
||||
"email": {
|
||||
"compose": "Redactar",
|
||||
"reply": "Responder",
|
||||
"replyAll": "Responder a todos",
|
||||
"forward": "Reenviar",
|
||||
"delete": "Eliminar",
|
||||
"archive": "Archivar",
|
||||
"markRead": "Marcar como leído",
|
||||
"markUnread": "Marcar como no leído",
|
||||
"star": "Destacar",
|
||||
"unstar": "Quitar destacado",
|
||||
"to": "Para",
|
||||
"cc": "CC",
|
||||
"bcc": "CCO",
|
||||
"subject": "Asunto",
|
||||
"body": "Mensaje",
|
||||
"send": "Enviar",
|
||||
"saveDraft": "Guardar como borrador",
|
||||
"discard": "Descartar",
|
||||
"attachments": "Adjuntos",
|
||||
"addAttachment": "Añadir adjunto",
|
||||
"noEmails": "Sin correos",
|
||||
"noSubject": "(Sin asunto)",
|
||||
"from": "De",
|
||||
"date": "Fecha"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Carpetas",
|
||||
"add": "Añadir carpeta",
|
||||
"edit": "Editar carpeta",
|
||||
"delete": "Eliminar carpeta",
|
||||
"name": "Nombre de carpeta"
|
||||
},
|
||||
"labels": {
|
||||
"title": "Etiquetas",
|
||||
"add": "Añadir etiqueta",
|
||||
"edit": "Editar etiqueta",
|
||||
"delete": "Eliminar etiqueta",
|
||||
"name": "Nombre de etiqueta",
|
||||
"color": "Color"
|
||||
},
|
||||
"accounts": {
|
||||
"title": "Cuentas de correo",
|
||||
"add": "Añadir cuenta",
|
||||
"edit": "Editar cuenta",
|
||||
"delete": "Eliminar cuenta",
|
||||
"name": "Nombre de cuenta",
|
||||
"address": "Dirección de correo",
|
||||
"default": "Cuenta predeterminada"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Configuración",
|
||||
"general": "General",
|
||||
"appearance": "Apariencia",
|
||||
"accounts": "Cuentas",
|
||||
"signature": "Firma",
|
||||
"language": "Idioma",
|
||||
"theme": "Tema",
|
||||
"darkMode": "Modo oscuro",
|
||||
"notifications": "Notificaciones"
|
||||
},
|
||||
"common": {
|
||||
"save": "Guardar",
|
||||
"cancel": "Cancelar",
|
||||
"delete": "Eliminar",
|
||||
"edit": "Editar",
|
||||
"add": "Añadir",
|
||||
"confirm": "Confirmar",
|
||||
"yes": "Sí",
|
||||
"no": "No",
|
||||
"ok": "OK",
|
||||
"loading": "Cargando...",
|
||||
"error": "Error",
|
||||
"success": "Éxito",
|
||||
"back": "Atrás",
|
||||
"search": "Buscar",
|
||||
"select": "Seleccionar",
|
||||
"selectAll": "Seleccionar todo"
|
||||
}
|
||||
}
|
||||
105
apps/mail/apps/web/src/lib/i18n/locales/fr.json
Normal file
105
apps/mail/apps/web/src/lib/i18n/locales/fr.json
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
{
|
||||
"app": {
|
||||
"name": "Mail",
|
||||
"loading": "Chargement..."
|
||||
},
|
||||
"nav": {
|
||||
"inbox": "Boîte de réception",
|
||||
"sent": "Envoyés",
|
||||
"drafts": "Brouillons",
|
||||
"starred": "Favoris",
|
||||
"archive": "Archives",
|
||||
"trash": "Corbeille",
|
||||
"spam": "Spam",
|
||||
"settings": "Paramètres",
|
||||
"feedback": "Feedback"
|
||||
},
|
||||
"auth": {
|
||||
"login": "Se connecter",
|
||||
"register": "S'inscrire",
|
||||
"logout": "Se déconnecter",
|
||||
"forgotPassword": "Mot de passe oublié",
|
||||
"email": "E-mail",
|
||||
"password": "Mot de passe",
|
||||
"confirmPassword": "Confirmer le mot de passe"
|
||||
},
|
||||
"email": {
|
||||
"compose": "Nouveau message",
|
||||
"reply": "Répondre",
|
||||
"replyAll": "Répondre à tous",
|
||||
"forward": "Transférer",
|
||||
"delete": "Supprimer",
|
||||
"archive": "Archiver",
|
||||
"markRead": "Marquer comme lu",
|
||||
"markUnread": "Marquer comme non lu",
|
||||
"star": "Ajouter aux favoris",
|
||||
"unstar": "Retirer des favoris",
|
||||
"to": "À",
|
||||
"cc": "CC",
|
||||
"bcc": "CCI",
|
||||
"subject": "Objet",
|
||||
"body": "Message",
|
||||
"send": "Envoyer",
|
||||
"saveDraft": "Enregistrer comme brouillon",
|
||||
"discard": "Annuler",
|
||||
"attachments": "Pièces jointes",
|
||||
"addAttachment": "Ajouter une pièce jointe",
|
||||
"noEmails": "Aucun e-mail",
|
||||
"noSubject": "(Sans objet)",
|
||||
"from": "De",
|
||||
"date": "Date"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Dossiers",
|
||||
"add": "Ajouter un dossier",
|
||||
"edit": "Modifier le dossier",
|
||||
"delete": "Supprimer le dossier",
|
||||
"name": "Nom du dossier"
|
||||
},
|
||||
"labels": {
|
||||
"title": "Libellés",
|
||||
"add": "Ajouter un libellé",
|
||||
"edit": "Modifier le libellé",
|
||||
"delete": "Supprimer le libellé",
|
||||
"name": "Nom du libellé",
|
||||
"color": "Couleur"
|
||||
},
|
||||
"accounts": {
|
||||
"title": "Comptes e-mail",
|
||||
"add": "Ajouter un compte",
|
||||
"edit": "Modifier le compte",
|
||||
"delete": "Supprimer le compte",
|
||||
"name": "Nom du compte",
|
||||
"address": "Adresse e-mail",
|
||||
"default": "Compte par défaut"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Paramètres",
|
||||
"general": "Général",
|
||||
"appearance": "Apparence",
|
||||
"accounts": "Comptes",
|
||||
"signature": "Signature",
|
||||
"language": "Langue",
|
||||
"theme": "Thème",
|
||||
"darkMode": "Mode sombre",
|
||||
"notifications": "Notifications"
|
||||
},
|
||||
"common": {
|
||||
"save": "Enregistrer",
|
||||
"cancel": "Annuler",
|
||||
"delete": "Supprimer",
|
||||
"edit": "Modifier",
|
||||
"add": "Ajouter",
|
||||
"confirm": "Confirmer",
|
||||
"yes": "Oui",
|
||||
"no": "Non",
|
||||
"ok": "OK",
|
||||
"loading": "Chargement...",
|
||||
"error": "Erreur",
|
||||
"success": "Succès",
|
||||
"back": "Retour",
|
||||
"search": "Rechercher",
|
||||
"select": "Sélectionner",
|
||||
"selectAll": "Tout sélectionner"
|
||||
}
|
||||
}
|
||||
105
apps/mail/apps/web/src/lib/i18n/locales/it.json
Normal file
105
apps/mail/apps/web/src/lib/i18n/locales/it.json
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
{
|
||||
"app": {
|
||||
"name": "Mail",
|
||||
"loading": "Caricamento..."
|
||||
},
|
||||
"nav": {
|
||||
"inbox": "Posta in arrivo",
|
||||
"sent": "Inviati",
|
||||
"drafts": "Bozze",
|
||||
"starred": "Speciali",
|
||||
"archive": "Archivio",
|
||||
"trash": "Cestino",
|
||||
"spam": "Spam",
|
||||
"settings": "Impostazioni",
|
||||
"feedback": "Feedback"
|
||||
},
|
||||
"auth": {
|
||||
"login": "Accedi",
|
||||
"register": "Registrati",
|
||||
"logout": "Esci",
|
||||
"forgotPassword": "Password dimenticata",
|
||||
"email": "E-mail",
|
||||
"password": "Password",
|
||||
"confirmPassword": "Conferma password"
|
||||
},
|
||||
"email": {
|
||||
"compose": "Scrivi",
|
||||
"reply": "Rispondi",
|
||||
"replyAll": "Rispondi a tutti",
|
||||
"forward": "Inoltra",
|
||||
"delete": "Elimina",
|
||||
"archive": "Archivia",
|
||||
"markRead": "Segna come letto",
|
||||
"markUnread": "Segna come non letto",
|
||||
"star": "Aggiungi a speciali",
|
||||
"unstar": "Rimuovi da speciali",
|
||||
"to": "A",
|
||||
"cc": "CC",
|
||||
"bcc": "CCN",
|
||||
"subject": "Oggetto",
|
||||
"body": "Messaggio",
|
||||
"send": "Invia",
|
||||
"saveDraft": "Salva come bozza",
|
||||
"discard": "Elimina",
|
||||
"attachments": "Allegati",
|
||||
"addAttachment": "Aggiungi allegato",
|
||||
"noEmails": "Nessuna email",
|
||||
"noSubject": "(Nessun oggetto)",
|
||||
"from": "Da",
|
||||
"date": "Data"
|
||||
},
|
||||
"folders": {
|
||||
"title": "Cartelle",
|
||||
"add": "Aggiungi cartella",
|
||||
"edit": "Modifica cartella",
|
||||
"delete": "Elimina cartella",
|
||||
"name": "Nome cartella"
|
||||
},
|
||||
"labels": {
|
||||
"title": "Etichette",
|
||||
"add": "Aggiungi etichetta",
|
||||
"edit": "Modifica etichetta",
|
||||
"delete": "Elimina etichetta",
|
||||
"name": "Nome etichetta",
|
||||
"color": "Colore"
|
||||
},
|
||||
"accounts": {
|
||||
"title": "Account email",
|
||||
"add": "Aggiungi account",
|
||||
"edit": "Modifica account",
|
||||
"delete": "Elimina account",
|
||||
"name": "Nome account",
|
||||
"address": "Indirizzo email",
|
||||
"default": "Account predefinito"
|
||||
},
|
||||
"settings": {
|
||||
"title": "Impostazioni",
|
||||
"general": "Generale",
|
||||
"appearance": "Aspetto",
|
||||
"accounts": "Account",
|
||||
"signature": "Firma",
|
||||
"language": "Lingua",
|
||||
"theme": "Tema",
|
||||
"darkMode": "Modalità scura",
|
||||
"notifications": "Notifiche"
|
||||
},
|
||||
"common": {
|
||||
"save": "Salva",
|
||||
"cancel": "Annulla",
|
||||
"delete": "Elimina",
|
||||
"edit": "Modifica",
|
||||
"add": "Aggiungi",
|
||||
"confirm": "Conferma",
|
||||
"yes": "Sì",
|
||||
"no": "No",
|
||||
"ok": "OK",
|
||||
"loading": "Caricamento...",
|
||||
"error": "Errore",
|
||||
"success": "Successo",
|
||||
"back": "Indietro",
|
||||
"search": "Cerca",
|
||||
"select": "Seleziona",
|
||||
"selectAll": "Seleziona tutto"
|
||||
}
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
import { authStore } from '$lib/stores/auth.svelte';
|
||||
import { accountsStore } from '$lib/stores/accounts.svelte';
|
||||
import { foldersStore } from '$lib/stores/folders.svelte';
|
||||
import '$lib/i18n';
|
||||
import '../app.css';
|
||||
|
||||
let { children } = $props();
|
||||
|
|
|
|||
20
apps/mail/apps/web/src/routes/feedback/+page.svelte
Normal file
20
apps/mail/apps/web/src/routes/feedback/+page.svelte
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<script lang="ts">
|
||||
import { FeedbackPage } from '@manacore/shared-feedback-ui';
|
||||
import { createFeedbackService } from '@manacore/shared-feedback-service';
|
||||
import { authStore } from '$lib/stores/auth.svelte';
|
||||
|
||||
const feedbackService = createFeedbackService({
|
||||
appName: 'mail',
|
||||
apiUrl: 'http://localhost:3001', // Mana Core API
|
||||
});
|
||||
|
||||
async function handleSubmit(data: { type: string; message: string; email?: string }) {
|
||||
const token = await authStore.getAccessToken();
|
||||
return feedbackService.submit({
|
||||
...data,
|
||||
token: token || undefined,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<FeedbackPage appName="Mail" onSubmit={handleSubmit} userEmail={authStore.user?.email} />
|
||||
Loading…
Add table
Add a link
Reference in a new issue