feat(editor): scope-colored InfoPanel badge + Time-travel label
Per redesign (4) prototype. - InfoPanel scope badge: было `<Badge variant="info">` (generic light bg). Стало scope-color filled chip: PUBLIC→accent-bg, INTERNAL→warn-bg, RESTRICTED→pink-bg. Matches table SCOPE col + filter pills. - i18n: timeTravel.button RU "Просмотр на дату" → "Time-travel…"; EN "View as of date" → "Time-travel…". User confirmed: "Time-travel label оставь" — единый label везде, без локализации (бренд-слово как редизайн).
This commit is contained in:
@@ -2,11 +2,17 @@ import { useMemo } from 'react'
|
||||
import { Link } from '@tanstack/react-router'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { ClockCounterClockwiseIcon, MapTrifoldIcon, DownloadSimpleIcon, ArrowRightIcon } from '@phosphor-icons/react'
|
||||
import { Badge } from '@/ui'
|
||||
import { useDictionaryDependents } from '@/api/queries'
|
||||
import type { DictionaryDetail, OnCloseAction, SchemaDependent } from '@/api/client'
|
||||
import type { DataScope, DictionaryDetail, OnCloseAction, SchemaDependent } from '@/api/client'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
/** Scope badge — solid scope-color bg per redesign prototype. */
|
||||
const SCOPE_BADGE_CLASS: Record<DataScope, string> = {
|
||||
PUBLIC: 'bg-accent-bg text-accent',
|
||||
INTERNAL: 'bg-warn-bg text-warn',
|
||||
RESTRICTED: 'bg-pink-bg text-pink',
|
||||
}
|
||||
|
||||
/**
|
||||
* EditorInfoPanel — left rail с dict metadata per handoff prototype Screen 2.
|
||||
*
|
||||
@@ -47,7 +53,14 @@ export function EditorInfoPanel({ detail, recordCount, actions }: EditorInfoPane
|
||||
return (
|
||||
<aside className="lg:sticky lg:top-2 self-start space-y-4 lg:max-h-[calc(100vh-7rem)] lg:overflow-y-auto pr-2">
|
||||
{/* Scope badge — top of panel */}
|
||||
<Badge variant="info">{detail.scope}</Badge>
|
||||
<span
|
||||
className={cn(
|
||||
'inline-flex items-center px-2.5 py-1 rounded-md text-cap tracking-[0.16em] font-semibold uppercase',
|
||||
SCOPE_BADGE_CLASS[detail.scope],
|
||||
)}
|
||||
>
|
||||
{detail.scope}
|
||||
</span>
|
||||
|
||||
{/* Description */}
|
||||
{detail.description && (
|
||||
|
||||
Reference in New Issue
Block a user