feat(validator info): add types

This commit is contained in:
Hristo Nedelkov 2024-03-27 23:16:05 +02:00
parent 3220e3b6c0
commit add34f80cc
1 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,7 @@ import Icon from '../../../../components/General/Icon'
import { useState } from 'react'
const ValidatorInfo = () => {
const intervalsOfTime = ['Day', 'Week', 'Month', 'Year']
const intervalsOfTime: string[] = ['Day', 'Week', 'Month', 'Year']
const [currentInterval, setCurrentInterval] = useState(0)
const toggleIntervalChange = () => {
@ -17,7 +17,8 @@ const ValidatorInfo = () => {
}
const togglePreviousInterval = () => {
setCurrentInterval(
prevInterval => (prevInterval - 1 + intervalsOfTime.length) % intervalsOfTime.length,
prevInterval =>
(prevInterval - 1 + intervalsOfTime.length) % intervalsOfTime.length,
)
}