1- import { XMarkIcon , ArrowTopRightOnSquareIcon , CheckIcon , ClockIcon } from "@heroicons/react/20/solid" ;
1+ import { XMarkIcon , ArrowTopRightOnSquareIcon , CheckIcon } from "@heroicons/react/20/solid" ;
22import { Link } from "@remix-run/react" ;
33import {
44 type MachinePresetName ,
55 formatDurationMilliseconds ,
66} from "@trigger.dev/core/v3" ;
7- import { useEffect , useState , type ReactNode } from "react" ;
7+ import { useEffect , useState } from "react" ;
88import { useTypedFetcher } from "remix-typedjson" ;
99import { cn } from "~/utils/cn" ;
1010import { Button } from "~/components/primitives/Buttons" ;
@@ -22,7 +22,7 @@ import { useOrganization } from "~/hooks/useOrganizations";
2222import { useProject } from "~/hooks/useProject" ;
2323import type { LogEntry } from "~/presenters/v3/LogsListPresenter.server" ;
2424import { getLevelColor } from "~/utils/logUtils" ;
25- import { v3RunSpanPath , v3RunsPath , v3BatchPath , v3RunPath , v3DeploymentVersionPath } from "~/utils/pathBuilder" ;
25+ import { v3RunSpanPath , v3RunsPath , v3DeploymentVersionPath } from "~/utils/pathBuilder" ;
2626import type { loader as logDetailLoader } from "~/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.logs.$logId" ;
2727import { TaskRunStatusCombo , descriptionForTaskRunStatus } from "~/components/runs/v3/TaskRunStatus" ;
2828import { MachineLabelCombo } from "~/components/MachineLabelCombo" ;
@@ -48,6 +48,12 @@ type LogDetailViewProps = {
4848
4949type TabType = "details" | "run" ;
5050
51+ type LogAttributes = Record < string , unknown > & {
52+ error ?: {
53+ message ?: string ;
54+ } ;
55+ } ;
56+
5157// Event kind badge color styles
5258function getKindColor ( kind : string ) : string {
5359 if ( kind === "SPAN" ) {
@@ -109,6 +115,7 @@ export function LogDetailView({ logId, initialLog, onClose, searchTerm }: LogDet
109115 fetcher . load (
110116 `/resources/orgs/${ organization . slug } /projects/${ project . slug } /env/${ environment . slug } /logs/${ encodeURIComponent ( logId ) } `
111117 ) ;
118+ // eslint-disable-next-line react-hooks/exhaustive-deps
112119 } , [ organization . slug , project . slug , environment . slug , logId ] ) ;
113120
114121 const isLoading = fetcher . state === "loading" ;
@@ -226,7 +233,7 @@ export function LogDetailView({ logId, initialLog, onClose, searchTerm }: LogDet
226233
227234function DetailsTab ( { log, runPath, searchTerm } : { log : LogEntry ; runPath : string ; searchTerm ?: string } ) {
228235 const logWithExtras = log as LogEntry & {
229- attributes ?: Record < string , unknown > ;
236+ attributes ?: LogAttributes ;
230237 } ;
231238
232239
@@ -242,7 +249,7 @@ function DetailsTab({ log, runPath, searchTerm }: { log: LogEntry; runPath: stri
242249 // Determine message to show
243250 let message = log . message ?? "" ;
244251 if ( log . level === "ERROR" ) {
245- const maybeErrorMessage = ( logWithExtras . attributes as any ) ?. error ?. message ;
252+ const maybeErrorMessage = logWithExtras . attributes ?. error ?. message ;
246253 if ( typeof maybeErrorMessage === "string" && maybeErrorMessage . length > 0 ) {
247254 message = maybeErrorMessage ;
248255 }
@@ -298,6 +305,7 @@ function RunTab({ log, runPath }: { log: LogEntry; runPath: string }) {
298305 fetcher . load (
299306 `/resources/orgs/${ organization . slug } /projects/${ project . slug } /env/${ environment . slug } /logs/${ encodeURIComponent ( log . id ) } /run?runId=${ encodeURIComponent ( log . runId ) } `
300307 ) ;
308+ // eslint-disable-next-line react-hooks/exhaustive-deps
301309 } , [ organization . slug , project . slug , environment . slug , log . id , log . runId ] ) ;
302310
303311 const isLoading = ! requested || fetcher . state === "loading" ;
0 commit comments