))
}
const getTimeZoneCaption = (
device: NoiseSensorDevice,
thresholds: NoiseThreshold[] | undefined
): string | null => {
if (device.location?.timezone != null) {
return `${t.allTimesIn} ${formatTimeZone(device.location.timezone)}`
}
const firstThreshold = thresholds?.[0]
if (firstThreshold != null) {
const zonedTime = ZonedTime.from(firstThreshold.starts_daily_at)
return `${t.allTimesIn} ${formatTimeZone(zonedTime.timeZone)}`
}
return null
}
const t = {
noiseThresholds: 'Noise thresholds',
tooltip:
'A noise threshold is the highest noise level (in dB) you want to allow for a given time range in the day.',
minutTooltipFirst:
'A noise threshold is the highest noise level (in dB) you want to allow.',
minutTooltipSecond:
'Quiet hours is a separate threshold that takes effect only for a specified time range.',
none: 'None',
loading: 'Loading...',
decibel: 'dB',
allTimesIn: 'All times in',
}