fix: put annotations and live indicator on same row in chart footer
This commit is contained in:
@@ -518,9 +518,13 @@ export default function Chart({
|
||||
)}
|
||||
</CardContent>
|
||||
|
||||
{/* Annotation tags */}
|
||||
{/* Footer: Annotations + Live indicator on same row */}
|
||||
{(annotationMarkers.length > 0 || lastUpdatedAt != null) && (
|
||||
<div className="px-4 sm:px-6 flex items-center justify-between gap-2 flex-wrap py-1.5 border-t border-neutral-100 dark:border-neutral-800">
|
||||
{/* Annotations left */}
|
||||
<div className="flex items-center gap-1 flex-wrap">
|
||||
{annotationMarkers.length > 0 && (
|
||||
<div className="px-4 sm:px-6 flex items-center gap-1 flex-wrap py-1.5 border-t border-neutral-100 dark:border-neutral-800">
|
||||
<>
|
||||
<span className="text-[10px] font-medium text-neutral-400 dark:text-neutral-500 mr-1">Annotations:</span>
|
||||
{annotationMarkers.map((marker) => {
|
||||
const primary = marker.annotations[0]
|
||||
@@ -565,12 +569,11 @@ export default function Chart({
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* Live indicator */}
|
||||
</div>
|
||||
{/* Live indicator right */}
|
||||
{lastUpdatedAt != null && (
|
||||
<div className="px-4 sm:px-6 pb-3 pt-2 flex justify-end">
|
||||
<div className="flex items-center gap-1.5 text-[11px] text-neutral-400 dark:text-neutral-500">
|
||||
<span className="relative flex h-1.5 w-1.5">
|
||||
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-green-500 opacity-75" />
|
||||
@@ -578,6 +581,7 @@ export default function Chart({
|
||||
</span>
|
||||
Live · {formatUpdatedAgo(lastUpdatedAt)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user