import { type HistoryTestResult, formatDuration } from "@allurereport/core-api"; import { IconButton, Text, TooltipWrapper, allureIcons } from "@allurereport/web-components"; import { type FunctionalComponent } from "preact"; import { useState } from "preact/hooks"; import { ArrowButton } from "@/components/ArrowButton"; import { TestResultError } from "@/components/TestResult/TestResultError"; import TreeItemIcon from "@/components/Tree/TreeItemIcon"; import { useI18n } from "@/stores"; import { navigateTo, openInNewTab } from "@/utils/navigate"; import { timestampToDate } from "@/utils/time"; import * as styles from "@/components/TestResult/TestResultHistory/styles.scss"; export const TestResultHistoryItem: FunctionalComponent<{ testResultItem: HistoryTestResult; }> = ({ testResultItem }) => { const { status, message, trace, stop, duration, id } = testResultItem; const [isOpened, setIsOpen] = useState(false); const convertedStop = timestampToDate(stop); const formattedDuration = formatDuration(duration as number); const { t } = useI18n("controls"); const navigateUrl = `testresult/${id}`; return (