import { Activity } from 'lucide-react';
import { isoDateFromTimestamp } from '@/portainer/filters/filters';
import { Environment } from '@/react/portainer/environments/types';
import heartbeatup from '@/assets/ico/heartbeat-up.svg?c';
import heartbeatdown from '@/assets/ico/heartbeat-down.svg?c';
import { EnvironmentStatusBadgeItem } from './EnvironmentStatusBadgeItem';
interface Props {
showLastCheckInDate?: boolean;
environment: Environment;
}
export function EdgeIndicator({
environment,
showLastCheckInDate = false,
}: Props) {
const heartbeat = environment.Heartbeat;
const associated = !!environment.EdgeID;
if (!associated) {
return (
Not associated
);
}
return (
heartbeat
{showLastCheckInDate && !!environment.LastCheckInDate && (
{isoDateFromTimestamp(environment.LastCheckInDate)}
)}
);
}