feat: add dynamic breadcrumb (#706)

* feat: add dynamic breadcrumb

* feat: pr feedback
This commit is contained in:
Manuel
2024-06-29 17:28:22 +02:00
committed by GitHub
parent be100b610e
commit 4e1bbf2ae6
21 changed files with 258 additions and 58 deletions

View File

@@ -8,6 +8,7 @@ export type SupportedLanguage = (typeof supportedLanguages)[number];
export const defaultLocale = "en";
export { languageMapping } from "./lang";
export type { TranslationKeys } from "./lang";
export const translateIfNecessary = (t: TranslationFunction, value: stringOrTranslation | undefined) => {
if (typeof value === "function") {

View File

@@ -11,3 +11,11 @@ export const languageMapping = () => {
return mapping as Record<(typeof supportedLanguages)[number], () => ReturnType<typeof enTranslations>>;
};
type NestedKeyOf<ObjectType extends object> = {
[Key in keyof ObjectType & (string | number)]: ObjectType[Key] extends object
? `${Key}` | `${Key}.${NestedKeyOf<ObjectType[Key]>}`
: `${Key}`;
}[keyof ObjectType & (string | number)];
export type TranslationKeys = NestedKeyOf<typeof enTranslations>;

View File

@@ -1508,4 +1508,53 @@ export default {
remove: "Remove",
},
},
navigationStructure: {
manage: {
label: "Manage",
boards: {
label: "Boards",
},
integrations: {
label: "Integrations",
edit: {
label: "Edit",
},
new: {
label: "New",
},
},
apps: {
label: "Apps",
new: {
label: "New App",
},
edit: {
label: "Edit App",
},
},
users: {
label: "Users",
create: {
label: "Create",
},
general: "General",
security: "Security",
},
tools: {
label: "Tools",
docker: {
label: "Docker",
},
logs: {
label: "Logs",
},
},
settings: {
label: "Settings",
},
about: {
label: "About",
},
},
},
} as const;