mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-22 22:15:42 +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) {
|
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 {
|
return {
|
||||||
song: data,
|
song: data,
|
||||||
|
@ -15,11 +15,11 @@ const config = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function Dashboard({metrics}: { metrics: MetricGroup }) {
|
export default function Dashboard({metrics}: { metrics: MetricGroup }) {
|
||||||
const {data: tempData} = useSWR('api/grafana/temp', fetcher, config)
|
const tempData = (useSWR('api/grafana/temp', fetcher, config)).data as { temp: string }
|
||||||
const {data: sysLoadData} = useSWR('api/grafana/sysload', fetcher, config)
|
const sysLoadData = (useSWR('api/grafana/sysload', fetcher, config)).data as { sysLoad: string }
|
||||||
const {data: ramData} = useSWR('api/grafana/ram', fetcher, config)
|
const ramData = (useSWR('api/grafana/ram', fetcher, config)).data as { ramUsage: string }
|
||||||
const {data: rootFsData} = useSWR('api/grafana/rootfs', fetcher, config)
|
const rootFsData = (useSWR('api/grafana/rootfs', fetcher, config)).data as { rootFsUsage: string }
|
||||||
const {data: uptimeData} = useSWR('api/grafana/uptime', fetcher, config)
|
const uptimeData = (useSWR('api/grafana/uptime', fetcher, config)).data as { days: number }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
Loading…
Reference in New Issue
Block a user