mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-11 18:45:41 +00:00
Fix ts errors
This commit is contained in:
parent
480111d758
commit
7797d83efa
@ -101,8 +101,14 @@ function AnimatedBars() {
|
||||
)
|
||||
}
|
||||
|
||||
type PlayerStateResponse = {
|
||||
data: Song
|
||||
error: string
|
||||
isLoading: boolean
|
||||
}
|
||||
|
||||
function usePlayerState(path: string) {
|
||||
const {data, error, isLoading} = useSWR(`/api/spotify/${path}`, fetcher)
|
||||
const {data, error, isLoading} = useSWR(`/api/spotify/${path}`, fetcher) as PlayerStateResponse
|
||||
|
||||
return {
|
||||
song: data,
|
||||
|
@ -15,11 +15,11 @@ const config = {
|
||||
}
|
||||
|
||||
export default function Dashboard({metrics}: { metrics: MetricGroup }) {
|
||||
const {data: tempData} = useSWR('api/grafana/temp', fetcher, config)
|
||||
const {data: sysLoadData} = useSWR('api/grafana/sysload', fetcher, config)
|
||||
const {data: ramData} = useSWR('api/grafana/ram', fetcher, config)
|
||||
const {data: rootFsData} = useSWR('api/grafana/rootfs', fetcher, config)
|
||||
const {data: uptimeData} = useSWR('api/grafana/uptime', fetcher, config)
|
||||
const tempData = (useSWR('api/grafana/temp', fetcher, config)).data as { temp: string }
|
||||
const sysLoadData = (useSWR('api/grafana/sysload', fetcher, config)).data as { sysLoad: string }
|
||||
const ramData = (useSWR('api/grafana/ram', fetcher, config)).data as { ramUsage: string }
|
||||
const rootFsData = (useSWR('api/grafana/rootfs', fetcher, config)).data as { rootFsUsage: string }
|
||||
const uptimeData = (useSWR('api/grafana/uptime', fetcher, config)).data as { days: number }
|
||||
|
||||
return (
|
||||
<>
|
||||
|
Loading…
Reference in New Issue
Block a user