studiocms
Version:
Astro Native CMS for AstroDB. Built from the ground up by the Astro community.
33 lines (32 loc) • 1.13 kB
TypeScript
import type { UiLanguageKeys } from 'studiocms:i18n';
import type { AvailableIcons } from 'studiocms:ui/icons';
/**
* Represents a link in the sidebar of the dashboard.
*/
interface SidebarLink {
title?: string;
key?: string;
icon: AvailableIcons;
href: string;
}
/**
* Represents the return value of the `getSidebarLinks` function.
*/
interface GetSidebarLinksReturn {
baseLinks: SidebarLink[];
editorLinks: SidebarLink[];
adminLinks: SidebarLink[];
ownerLinks: SidebarLink[];
}
/**
* Generates the sidebar links for the dashboard based on the user's language and role.
*
* @param {UiLanguageKeys} lang - The language key for translations.
* @returns {GetSidebarLinksReturn} An object containing arrays of sidebar links categorized by user roles:
* - `baseLinks`: Links accessible to all users.
* - `editorLinks`: Links accessible to users with editor role.
* - `adminLinks`: Links accessible to users with admin role.
* - `ownerLinks`: Links accessible to users with owner role.
*/
export declare function getSidebarLinks(lang: UiLanguageKeys): GetSidebarLinksReturn;
export {};