Chuyển tới nội dung chính

HistoricalViewBanner

A banner component indicating that the user is viewing historical data.

📋 Overview

PropertyValue
Filesrc/components/HistoricalViewBanner.tsx
TypeReact Functional Component
AuthorUIP Team
Version1.0.0

🎯 Purpose

  • Indicate historical data viewing mode
  • Display selected time period
  • Provide quick exit to live view
  • Show data staleness warning

🚀 Usage

import { HistoricalViewBanner } from '@/components/HistoricalViewBanner';

function Dashboard() {
return (
<>
{isHistoricalView && (
<HistoricalViewBanner
timestamp={selectedTime}
onExitHistorical={handleExitHistorical}
/>
)}
<TrafficMap />
</>
);
}

📦 Props

PropTypeRequiredDefaultDescription
timestampDateYes-Historical timestamp
onExitHistorical() => voidYes-Exit handler
showDiffbooleanNotrueShow time difference

🎨 Banner Styles

  • Background: Semi-transparent amber
  • Icon: Clock/history icon
  • Text: "Viewing data from [date/time]"
  • Button: "Return to Live View"

See the complete components reference for all available components.