2024-04-07 21:52:59 +03:00
|
|
|
import { StepApiResponse } from "@/api/types";
|
|
|
|
|
import { StatusBadge } from "@/components/StatusBadge";
|
|
|
|
|
import { Label } from "@/components/ui/label";
|
|
|
|
|
import { Skeleton } from "@/components/ui/skeleton";
|
2024-11-11 13:03:40 -08:00
|
|
|
import { basicLocalTimeFormat, basicTimeFormat } from "@/util/timeFormat";
|
2024-04-07 21:52:59 +03:00
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
isFetching: boolean;
|
|
|
|
|
stepProps?: StepApiResponse;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function StepInfo({ isFetching, stepProps }: Props) {
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex flex-col gap-4 p-4">
|
|
|
|
|
<div className="flex items-center">
|
|
|
|
|
<Label className="w-24">Step ID:</Label>
|
|
|
|
|
{isFetching ? (
|
|
|
|
|
<Skeleton className="h-4 w-40" />
|
|
|
|
|
) : (
|
|
|
|
|
<span>{stepProps?.step_id}</span>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flex items-center">
|
|
|
|
|
<Label className="w-24">Status:</Label>
|
|
|
|
|
{isFetching ? (
|
|
|
|
|
<Skeleton className="h-4 w-40" />
|
|
|
|
|
) : stepProps ? (
|
|
|
|
|
<StatusBadge status={stepProps.status} />
|
|
|
|
|
) : null}
|
|
|
|
|
</div>
|
|
|
|
|
<div className="flex items-center">
|
|
|
|
|
<Label className="w-24">Created At:</Label>
|
|
|
|
|
{isFetching ? (
|
|
|
|
|
<Skeleton className="h-4 w-40" />
|
|
|
|
|
) : stepProps ? (
|
2024-11-11 13:03:40 -08:00
|
|
|
<span title={basicTimeFormat(stepProps.created_at)}>
|
|
|
|
|
{basicLocalTimeFormat(stepProps.created_at)}
|
|
|
|
|
</span>
|
2024-04-07 21:52:59 +03:00
|
|
|
) : null}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export { StepInfo };
|