25 lines
753 B
TypeScript
25 lines
753 B
TypeScript
import { formatTime } from "../utils/time";
|
||
import type { TrackPoint } from "../types";
|
||
|
||
type TrackSummaryProps = {
|
||
lastPoint: TrackPoint | null;
|
||
pointsCount: number;
|
||
compact?: boolean;
|
||
};
|
||
|
||
export const TrackSummary = ({ lastPoint, pointsCount, compact }: TrackSummaryProps) => (
|
||
<div className={`mini-info ${compact ? "compact" : ""}`}>
|
||
<div className="chip small">
|
||
<span>Последняя фиксация</span>
|
||
<strong>{formatTime(lastPoint?.timestamp)}</strong>
|
||
</div>
|
||
<div className="chip small">
|
||
<span>Точек трека</span>
|
||
<strong>{pointsCount}</strong>
|
||
</div>
|
||
<div className="chip small">
|
||
<span>Статус</span>
|
||
<strong>ок</strong>
|
||
</div>
|
||
</div>
|
||
);
|