Files
timmal/app/composables/usePageTitle.ts
Lucien Cartier-Tilet ea28a87860
All checks were successful
ci / ci (push) Successful in 19m53s
feat: authentication with OAuth
2025-12-10 21:21:38 +01:00

16 lines
451 B
TypeScript

export const usePageTitle = () => {
const pageName = useState<string | null>('pageName', () => null);
const title = computed<string>(() => ((pageName.value ?? '').length > 0 ? `${pageName.value} - Tímmál` : 'Tímmál'));
const setPageName = (newName: string | null) => {
pageName.value = newName;
useHead({ title: title.value });
};
return {
title: readonly(title),
pageName: readonly(pageName),
setPageName,
};
};