You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
spa_instat_tv/src/features/MatchPage/hooks/useMatchProfile.tsx

25 lines
515 B

import {
useEffect,
useState,
} from 'react'
import type { MatchInfo } from 'requests'
import { getMatchInfo } from 'requests'
import { useSportNameParam, usePageId } from 'hooks'
export const useMatchProfile = () => {
const [matchProfile, setMatchProfile] = useState<MatchInfo>(null)
const { sportType } = useSportNameParam()
const matchId = usePageId()
useEffect(() => {
getMatchInfo(sportType, matchId).then(setMatchProfile)
},
[
sportType,
matchId,
])
return matchProfile
}