feature(dashboard): remember last selected range

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-10-23 21:47:59 +02:00
parent 2329982cd1
commit 8c4d157633
3 changed files with 43 additions and 3 deletions

View File

@@ -89,7 +89,8 @@ export function ListReports({ reports, dashboard }: ListReportsProps) {
<div className="mt-2 flex gap-2 ">
<span
className={
range !== null || (startDate && endDate)
(chartRange !== range && range !== null) ||
(startDate && endDate)
? 'line-through'
: ''
}
@@ -99,7 +100,10 @@ export function ListReports({ reports, dashboard }: ListReportsProps) {
{startDate && endDate ? (
<span>Custom dates</span>
) : (
range !== null && <span>{range}</span>
range !== null &&
chartRange !== range && (
<span>{timeWindows[range].label}</span>
)
)}
</div>
)}