@@ -8,6 +8,8 @@ import { LineChart, Line, XAxis, YAxis, Tooltip, ResponsiveContainer } from 'rec
88import { FaChartLine , FaHashtag , FaCog , FaTrash } from 'react-icons/fa' ;
99import { useGridStackContext } from '../lib/grid-stack-context' ;
1010import i18n from '@utils/i18n' ;
11+ import { FlowBiteConstants } from '@/utils/constants' ;
12+
1113
1214// Define a type for timestamped reflectance data
1315interface TimestampedReflectanceData {
@@ -150,7 +152,7 @@ const Reflectance: React.FC = () => {
150152 return (
151153 < SensorCard { ...sensorCardProps } >
152154 < div className = "absolute top-4 right-4 flex items-center space-x-2" >
153- < Dropdown label = { < FaCog size = { 16 } /> } className = "font-bold flex items-center text-sm border border-gray-300 rounded" >
155+ < Dropdown label = { < FaCog size = { 16 } /> } inline = { true } theme = { FlowBiteConstants . DropdownTheme } className = "font-bold flex items-center text-sm border border-gray-300 rounded" >
154156 < DropdownItem onClick = { ( ) => handleAction ( 'graph' ) } >
155157 < div className = "flex items-center space-x-2" >
156158 < FaChartLine size = { 16 } />
@@ -187,15 +189,15 @@ const Reflectance: React.FC = () => {
187189 < XAxis
188190 dataKey = "timestamp"
189191 tick = { false }
190- label = "Time"
192+ label = { i18n . t ( 'time' ) }
191193 />
192194 < YAxis />
193195 < Tooltip
194196 labelFormatter = { ( value ) => new Date ( value ) . toLocaleTimeString ( ) }
195197 formatter = { ( value ) => typeof value === 'number' ? value . toFixed ( 0 ) : value }
196198 />
197- < Line type = "monotone" dataKey = "reflectanceL" stroke = { sideColors . reflectanceL } dot = { false } name = "Left" />
198- < Line type = "monotone" dataKey = "reflectanceR" stroke = { sideColors . reflectanceR } dot = { false } name = "Right" />
199+ < Line type = "monotone" dataKey = "reflectanceL" stroke = { sideColors . reflectanceL } dot = { false } name = { i18n . t ( 'left' ) } />
200+ < Line type = "monotone" dataKey = "reflectanceR" stroke = { sideColors . reflectanceR } dot = { false } name = { i18n . t ( 'right' ) } />
199201 </ LineChart >
200202 </ ResponsiveContainer >
201203 < div className = "text-xs text-gray-500 text-center mt-2 dark:text-gray-400" >
@@ -220,7 +222,7 @@ const Reflectance: React.FC = () => {
220222 < div className = "w-6 h-6 rounded-full bg-white opacity-80" > </ div >
221223 </ div >
222224 < span className = "text-xs font-medium" style = { { color : sideColors . reflectanceL } } >
223- LEFT
225+ { i18n . t ( 'left' ) }
224226 </ span >
225227 </ div >
226228
@@ -236,7 +238,7 @@ const Reflectance: React.FC = () => {
236238 < div className = "w-6 h-6 rounded-full bg-white opacity-80" > </ div >
237239 </ div >
238240 < span className = "text-xs font-medium" style = { { color : sideColors . reflectanceR } } >
239- RIGHT
241+ { i18n . t ( 'right' ) }
240242 </ span >
241243 </ div >
242244 </ div >
@@ -248,7 +250,7 @@ const Reflectance: React.FC = () => {
248250 < div >
249251 < div className = "flex justify-between items-center mb-1" >
250252 < span className = "text-sm font-medium" style = { { color : sideColors . reflectanceL } } >
251- Left
253+ { i18n . t ( 'left' ) }
252254 </ span >
253255 < span className = "text-sm font-mono" >
254256 { reflectanceData . reflectanceL }
@@ -269,7 +271,7 @@ const Reflectance: React.FC = () => {
269271 < div >
270272 < div className = "flex justify-between items-center mb-1" >
271273 < span className = "text-sm font-medium" style = { { color : sideColors . reflectanceR } } >
272- Right
274+ { i18n . t ( 'right' ) }
273275 </ span >
274276 < span className = "text-sm font-mono" >
275277 { reflectanceData . reflectanceR }
@@ -291,13 +293,13 @@ const Reflectance: React.FC = () => {
291293 < div className = "grid grid-cols-2 gap-4 text-center" >
292294 < div className = "flex flex-col items-center" >
293295 < span className = "text-xs font-medium" style = { { color : sideColors . reflectanceL } } >
294- Left Reflectance
296+ { i18n . t ( 'left-reflectance' ) }
295297 </ span >
296298 < span className = "font-mono text-lg" > { reflectanceData . reflectanceL } </ span >
297299 </ div >
298300 < div className = "flex flex-col items-center" >
299301 < span className = "text-xs font-medium" style = { { color : sideColors . reflectanceR } } >
300- Right Reflectance
302+ { i18n . t ( 'right-reflectance' ) }
301303 </ span >
302304 < span className = "font-mono text-lg" > { reflectanceData . reflectanceR } </ span >
303305 </ div >
0 commit comments