fix: avoid nested links in device card

This commit is contained in:
Esdras Renan 2025-11-18 20:03:08 -03:00
parent 72a4748a81
commit 744dcd1895

View file

@ -5749,6 +5749,7 @@ function DevicesGrid({ devices, companyNameBySlug }: { devices: DevicesQueryItem
} }
function DeviceCard({ device, companyName }: { device: DevicesQueryItem; companyName?: string | null }) { function DeviceCard({ device, companyName }: { device: DevicesQueryItem; companyName?: string | null }) {
const router = useRouter()
const effectiveStatus = resolveDeviceStatus(device) const effectiveStatus = resolveDeviceStatus(device)
const isActive = device.isActive const isActive = device.isActive
const lastHeartbeat = device.lastHeartbeatAt ? new Date(device.lastHeartbeatAt) : null const lastHeartbeat = device.lastHeartbeatAt ? new Date(device.lastHeartbeatAt) : null
@ -5840,7 +5841,17 @@ function DeviceCard({ device, companyName }: { device: DevicesQueryItem; company
<span className="rounded-full border border-slate-300 bg-slate-100 px-2 py-0.5"> <span className="rounded-full border border-slate-300 bg-slate-100 px-2 py-0.5">
Usuário vinculado: {collaborator.name ? `${collaborator.name} · ` : ""}{collaborator.email} Usuário vinculado: {collaborator.name ? `${collaborator.name} · ` : ""}{collaborator.email}
</span> </span>
<Link href="/admin/users" className="underline underline-offset-4">Gerenciar usuários</Link> <button
type="button"
className="underline underline-offset-4 hover:text-slate-800"
onClick={(event) => {
event.preventDefault()
event.stopPropagation()
router.push("/admin/users")
}}
>
Gerenciar usuários
</button>
</div> </div>
) : null} ) : null}
{!isActive ? ( {!isActive ? (