dify/web/app/components/main-nav/utils.ts
Jingyi-Dify 5ff182a4b6 refactor(web): split main nav components
- Move MainNav sections into focused components under main-nav/components

- Reuse Explore AppNavItem for MainNav web app rows via a mainNav variant

- Keep WorkspaceCard expanded panel behavior and styling aligned with the pre-refactor UI
2026-05-08 17:31:21 -07:00

6 lines
274 B
TypeScript

export const getWorkspaceInitial = (name?: string) => name?.[0]?.toLocaleUpperCase() || '?'
export const getRemainingCredits = (total: number, used: number) => Math.max(total - used, 0)
export const formatCredits = (value: number) => new Intl.NumberFormat().format(value)