From d5ee8ae0f3a931535748b3d5780ffc740246417f Mon Sep 17 00:00:00 2001 From: Aarnav Tale Date: Mon, 4 Nov 2024 14:59:13 -0500 Subject: [PATCH] fix: clicking a machine name in users page redirects --- app/components/Attribute.tsx | 9 +++++++-- app/routes/_data.users._index/route.tsx | 7 ++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/components/Attribute.tsx b/app/components/Attribute.tsx index 31ac667..1d8c6e6 100644 --- a/app/components/Attribute.tsx +++ b/app/components/Attribute.tsx @@ -6,14 +6,19 @@ interface Props { name: string value: string isCopyable?: boolean + link?: string } -export default function Attribute({ name, value, isCopyable }: Props) { +export default function Attribute({ name, value, link, isCopyable }: Props) { const canCopy = isCopyable ?? false return (
- {name} + {link ? ( + + {name} + + ) : name}
{canCopy diff --git a/app/routes/_data.users._index/route.tsx b/app/routes/_data.users._index/route.tsx index b7a6e5b..7a5039b 100644 --- a/app/routes/_data.users._index/route.tsx +++ b/app/routes/_data.users._index/route.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import { type DataRef, DndContext, useDraggable, useDroppable } from '@dnd-kit/core' +import { DataRef, DndContext, useDraggable, useDroppable } from '@dnd-kit/core' import { PersonIcon } from '@primer/octicons-react' -import { type ActionFunctionArgs, json, type LoaderFunctionArgs } from '@remix-run/node' +import { ActionFunctionArgs, json, LoaderFunctionArgs } from '@remix-run/node' import { useActionData, useLoaderData, useSubmit } from '@remix-run/react' import { useEffect, useState } from 'react' import { ClientOnly } from 'remix-utils/client-only' @@ -10,7 +10,7 @@ import Attribute from '~/components/Attribute' import Card from '~/components/Card' import StatusCircle from '~/components/StatusCircle' import { toast } from '~/components/Toaster' -import { type Machine, type User } from '~/types' +import { Machine, User } from '~/types' import { cn } from '~/utils/cn' import { loadContext } from '~/utils/config/headplane' import { loadConfig } from '~/utils/config/headscale' @@ -299,6 +299,7 @@ function MachineChip({ machine }: { readonly machine: Machine }) {