refactor: calculation of document titles into another class
This commit is contained in:
15
frontend/src/utils/documentTitle.ts
Normal file
15
frontend/src/utils/documentTitle.ts
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user