import { Code, IconButton, Loadable, TooltipWrapper, allureIcons } from "@allurereport/web-components"; import type { FunctionalComponent } from "preact"; import type { ClassicTestResult } from "types"; import { useI18n } from "@/stores"; import { testResultNavStore } from "@/stores/testResults"; import { copyToClipboard } from "@/utils/copyToClipboard"; import { navigateTo } from "@/utils/navigate"; import * as styles from "./styles.scss"; export type TestResultNavigationProps = { testResult?: ClassicTestResult; }; export const TestResultNavigation: FunctionalComponent = ({ testResult }) => { const { fullName, id: testResultId } = testResult ?? {}; const id = testResultId || ""; const { t: tooltip } = useI18n("controls"); const FullName = () => { return (
copyToClipboard(fullName)} /> {fullName && fullName}
); }; return ( { const currentIndex = data.indexOf(id) + 1; return (
{fullName && } {data && !testResult?.isRetry && (
1}> navigateTo(data[currentIndex])} /> {currentIndex}/{data.length} navigateTo(data[currentIndex - 2])} />
)}
); }} /> ); };