feat(transparency): make device names clickable in transparency log
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,7 @@ import {
|
|||||||
} from '@/lib/transparencyApi'
|
} from '@/lib/transparencyApi'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
import { EmptyState } from '@/components/ui/empty-state'
|
import { EmptyState } from '@/components/ui/empty-state'
|
||||||
|
import { DeviceLink } from '@/components/ui/device-link'
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Constants
|
// Constants
|
||||||
@@ -349,6 +350,7 @@ export function TransparencyLogTable({ tenantId }: TransparencyLogTableProps) {
|
|||||||
<TransparencyLogRow
|
<TransparencyLogRow
|
||||||
key={item.id}
|
key={item.id}
|
||||||
item={item}
|
item={item}
|
||||||
|
tenantId={tenantId}
|
||||||
isExpanded={expandedId === item.id}
|
isExpanded={expandedId === item.id}
|
||||||
onToggle={() =>
|
onToggle={() =>
|
||||||
setExpandedId(expandedId === item.id ? null : item.id)
|
setExpandedId(expandedId === item.id ? null : item.id)
|
||||||
@@ -454,12 +456,14 @@ function StatsCard({ icon: Icon, label, value }: StatsCardProps) {
|
|||||||
|
|
||||||
interface TransparencyLogRowProps {
|
interface TransparencyLogRowProps {
|
||||||
item: TransparencyLogEntry
|
item: TransparencyLogEntry
|
||||||
|
tenantId: string
|
||||||
isExpanded: boolean
|
isExpanded: boolean
|
||||||
onToggle: () => void
|
onToggle: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
function TransparencyLogRow({
|
function TransparencyLogRow({
|
||||||
item,
|
item,
|
||||||
|
tenantId,
|
||||||
isExpanded,
|
isExpanded,
|
||||||
onToggle,
|
onToggle,
|
||||||
}: TransparencyLogRowProps) {
|
}: TransparencyLogRowProps) {
|
||||||
@@ -494,7 +498,11 @@ function TransparencyLogRow({
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="px-3 py-2 text-text-secondary truncate max-w-[140px]">
|
<td className="px-3 py-2 text-text-secondary truncate max-w-[140px]">
|
||||||
{item.device_name ?? '--'}
|
{item.device_name && item.device_id ? (
|
||||||
|
<DeviceLink tenantId={tenantId} deviceId={item.device_id}>
|
||||||
|
{item.device_name}
|
||||||
|
</DeviceLink>
|
||||||
|
) : (item.device_name ?? '--')}
|
||||||
</td>
|
</td>
|
||||||
<td className="px-3 py-2">
|
<td className="px-3 py-2">
|
||||||
<span className="inline-flex items-center rounded px-1.5 py-0.5 text-[11px] font-medium border bg-accent/10 text-accent border-accent/20">
|
<span className="inline-flex items-center rounded px-1.5 py-0.5 text-[11px] font-medium border bg-accent/10 text-accent border-accent/20">
|
||||||
|
|||||||
Reference in New Issue
Block a user