feat(ui): add DeviceLink reusable component
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
21
frontend/src/components/ui/device-link.tsx
Normal file
21
frontend/src/components/ui/device-link.tsx
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import { Link } from '@tanstack/react-router'
|
||||||
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
|
interface DeviceLinkProps {
|
||||||
|
tenantId: string
|
||||||
|
deviceId: string
|
||||||
|
children: React.ReactNode
|
||||||
|
className?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function DeviceLink({ tenantId, deviceId, children, className }: DeviceLinkProps) {
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
to="/tenants/$tenantId/devices/$deviceId"
|
||||||
|
params={{ tenantId, deviceId }}
|
||||||
|
className={cn('hover:text-text-primary hover:underline', className)}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user