Fixes: None; Extra: 1) Create Pinia stores for app, user, category, and company management; 2) Add utility functions for error handling and category slug lookups; 3) Include German locale file and robots.txt for improved SEO and accessibility; 4) Add SVG assets and improve general folder structure for better maintainability.
40 lines
No EOL
970 B
TypeScript
40 lines
No EOL
970 B
TypeScript
export function useMailClient() {
|
|
const mailClientUrl = ref<string | null>(null);
|
|
|
|
const mailClients = {
|
|
'gmail.com': 'https://mail.google.com/',
|
|
'outlook.com': 'https://outlook.live.com/',
|
|
'icloud.com': 'https://www.icloud.com/mail/',
|
|
'yahoo.com': 'https://mail.yahoo.com/',
|
|
'mail.ru': 'https://e.mail.ru/inbox/',
|
|
'yandex.ru': 'https://mail.yandex.ru/',
|
|
'proton.me': 'https://account.proton.me/mail',
|
|
'fastmail.com': 'https://fastmail.com/'
|
|
};
|
|
|
|
function detectMailClient(email: string) {
|
|
mailClientUrl.value = null;
|
|
|
|
if (!email) return;
|
|
|
|
const domain = email.split('@')[1];
|
|
|
|
Object.entries(mailClients).forEach((el) => {
|
|
if (domain === el[0]) mailClientUrl.value = el[1];
|
|
});
|
|
|
|
return mailClientUrl.value;
|
|
}
|
|
|
|
function openMailClient() {
|
|
if (mailClientUrl.value) {
|
|
window.open(mailClientUrl.value);
|
|
}
|
|
}
|
|
|
|
return {
|
|
mailClientUrl,
|
|
detectMailClient,
|
|
openMailClient
|
|
};
|
|
} |