refactor: calculation of document titles into another class

This commit is contained in:
2026-03-03 18:18:05 +00:00
parent f63f4e5f10
commit d11c5acb77
2 changed files with 19 additions and 7 deletions

View File

@@ -0,0 +1,15 @@
const DEFAULT_TITLE = "Ethnograph View";
const STATIC_TITLES: Record<string, string> = {
"/login": "Sign In",
"/upload": "Upload Dataset",
"/stats": "Stats",
};
export const getDocumentTitle = (pathname: string) => {
if (pathname.includes("status")) {
return "Processing Dataset";
}
return STATIC_TITLES[pathname] ?? DEFAULT_TITLE;
};