Fix typed i18n keys for customer access labels.

Unblocks the business dashboard production build after Customer/Manager role UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-10 21:33:22 +03:30
co-authored by Cursor
parent f622e6d605
commit beec3035e5
2 changed files with 18 additions and 3 deletions
@@ -2,6 +2,7 @@ import { useEffect, useMemo, useState } from 'react'
import { createPortal } from 'react-dom'
import { X } from 'lucide-react'
import { useT } from '../i18n/useT'
import type { BusinessMessageKey } from '../i18n/messages'
import { ApiError } from '../lib/api'
import {
assignBusinessAccess,
@@ -16,6 +17,12 @@ const ANIMATION_MS = 220
const ALL_TEAM_ROLES = ['admin', 'editor', 'viewer'] as const
const BUSINESS_TEAM_ROLES = ['editor', 'viewer'] as const
const TEAM_ROLE_LABEL_KEYS: Record<(typeof ALL_TEAM_ROLES)[number], BusinessMessageKey> = {
admin: 'customers.access.role.admin',
editor: 'customers.access.role.editor',
viewer: 'customers.access.role.viewer',
}
export interface ChangeUserAccessModalProps {
open: boolean
user: BusinessCustomerListItem | null
@@ -195,7 +202,7 @@ export function ChangeUserAccessModal({
disabled={submitting}
/>
<span className={styles.roleOptionLabel}>
{t(`customers.access.role.${slug}`)}
{t(TEAM_ROLE_LABEL_KEYS[slug as (typeof ALL_TEAM_ROLES)[number]])}
</span>
</label>
))}