-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implemented Enriched UI responses for StarSearch (#3394)
- Loading branch information
1 parent
3c5310b
commit 9886681
Showing
2 changed files
with
258 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import LotteryFactorChart from "components/Repositories/LotteryFactorChart"; | ||
import { useRepositoryLottoFactor } from "lib/hooks/api/useRepositoryLottoFactor"; | ||
|
||
interface LotteryFactorWidgetProps { | ||
repoName: string; | ||
} | ||
|
||
const LotteryFactorWidget = ({ repoName }: LotteryFactorWidgetProps) => { | ||
const range = 30; | ||
const { data, error, isLoading } = useRepositoryLottoFactor({ repository: repoName.toLowerCase(), range }); | ||
|
||
if (error) { | ||
// whether it's a 404 or any other error, we don't want to render the widget | ||
// StarSearch will handle the error. | ||
throw error; | ||
} | ||
|
||
return <LotteryFactorChart lotteryFactor={data} isLoading={isLoading} error={error} range={range} />; | ||
}; | ||
|
||
export default LotteryFactorWidget; |
Oops, something went wrong.