feat(design-preview): плитки приложений с адресом и способом входа как в канвасе
В QuickActionGrid добавлены необязательные meta и badgeVariant (обратно совместимо). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
1 parent
fe5d58b13b
commit
a31a964228
2 files changed
+11
-1
No files matched your search
@@ -20,6 +20,10 @@ export interface QuickActionItem {
|
||||
search?: Record<string, unknown>
|
||||
onSelect?: () => void
|
||||
badgeLabel?: string
|
||||
/** Вариант бейджа действия (по умолчанию outline). */
|
||||
badgeVariant?: 'outline' | 'info-light' | 'warning-light'
|
||||
/** Моноширинная подпись под описанием: адрес · способ входа. */
|
||||
meta?: string
|
||||
icon?: ReactNode
|
||||
iconClassName?: string
|
||||
}
|
||||
@@ -49,13 +53,16 @@ function QuickActionBody({ action }: { action: QuickActionItem }) {
|
||||
<div className="flex min-w-0 flex-1 flex-col gap-0.5">
|
||||
<div className="flex items-start justify-between gap-2">
|
||||
<span className="text-foreground text-sm font-medium">{action.title}</span>
|
||||
<Badge variant="outline" size="sm" className="shrink-0">
|
||||
<Badge variant={action.badgeVariant ?? 'outline'} size="sm" className="shrink-0">
|
||||
{action.badgeLabel ?? 'Перейти'}
|
||||
</Badge>
|
||||
</div>
|
||||
<p className="text-muted-foreground line-clamp-2 text-xs leading-relaxed">
|
||||
{action.description}
|
||||
</p>
|
||||
{action.meta ? (
|
||||
<p className="text-muted-foreground truncate font-mono text-[11px]">{action.meta}</p>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -62,6 +62,8 @@ export function AppsPage() {
|
||||
title: app.title,
|
||||
description: app.description,
|
||||
badgeLabel: 'Открыть',
|
||||
badgeVariant: 'info-light' as const,
|
||||
meta: `${app.url.replace('https://', '')} · ${app.authMode === 'oidc' ? 'OIDC' : 'JWT'}`,
|
||||
icon: <Icon />,
|
||||
onSelect: () => toast(`Открыть ${app.title}`, { description: `${app.url.replace('https://', '')} · ${app.authMode.toUpperCase()} (макет)` }),
|
||||
}
|
||||
@@ -79,6 +81,7 @@ export function AppsPage() {
|
||||
title: app.title,
|
||||
description: app.description,
|
||||
badgeLabel: 'Нет доступа',
|
||||
meta: `${app.url.replace('https://', '')} · ${app.authMode === 'oidc' ? 'OIDC' : 'JWT'}`,
|
||||
icon: <Icon />,
|
||||
onSelect: () => toast.warning(`Нет доступа к ${app.title}`, { description: 'Запросите права у администратора.' }),
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user