import { type HistoryTestResult, capitalize } from "@allurereport/core-api"; import { SvgIcon, Text, TooltipWrapper, allureIcons } from "@allurereport/web-components"; import type { FunctionalComponent } from "preact"; import type { ClassicTestResult } from "types"; import { useI18n } from "@/stores"; import { timestampToDate } from "@/utils/time"; import * as styles from "./styles.scss"; const TestResultPrevStatus: FunctionalComponent<{ item: HistoryTestResult }> = ({ item }) => { const navigateUrl = new URL(item.id, item.url); return ( ); }; const TestResultPrevStatusTooltip: FunctionalComponent<{ item: HistoryTestResult }> = ({ item }) => { const convertedStop = item.stop && timestampToDate(item.stop); const { t } = useI18n("statuses"); const status = t(item.status); return (
{capitalize(status)} {convertedStop}
); }; export type TestResultPrevStatusesProps = { history: ClassicTestResult["history"]; }; export const TestResultPrevStatuses: FunctionalComponent = ({ history }) => { return (
{history?.slice(0, 6).map((item, key) => (
}>
))}
); };