Files
timmal/app/composables/usePageTitle.ts
Lucien Cartier-Tilet 1bdfbdb446
Some checks failed
ci / ci (22, ubuntu-latest) (push) Failing after 6m46s
feat: authentication with OAuth
2025-12-09 08:55:46 +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,
};
};