mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-07-16 08:27:05 -05:00
fix type error, move xtrends hook location
This commit is contained in:
parent
ca8c288810
commit
9ab84e754f
|
|
@ -3,7 +3,7 @@ import { Trans } from "@lingui/macro";
|
|||
import ModeSelector from "components/common/ModeSelector";
|
||||
import HeaderBanner from "components/layout/HeaderBanner";
|
||||
import { useMyTheme } from "hooks/common";
|
||||
import { useXTrends } from "hooks/xtrends";
|
||||
import { useXTrends } from "../hooks/useXTrends";
|
||||
import { XTrends } from "../service";
|
||||
import TrendTier from "./TrendTier";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { RankedMode } from "@prisma/client";
|
||||
import { XTrends } from "app/xrank/service";
|
||||
import { getMonthOptions } from "pages/xsearch/[[...slug]]";
|
||||
import { GetXTrendsData } from "prisma/queries/getXTrends";
|
||||
import { Dispatch, useMemo, useReducer } from "react";
|
||||
|
||||
interface XTrendsState {
|
||||
|
|
@ -22,7 +22,7 @@ type Action =
|
|||
|
||||
export type XTrendsDispatch = Dispatch<Action>;
|
||||
|
||||
export function useXTrends(trends: GetXTrendsData) {
|
||||
export function useXTrends(trends: XTrends) {
|
||||
const getLatestYear = () =>
|
||||
parseInt(Object.keys(trends).sort((a, b) => parseInt(b) - parseInt(a))[0]);
|
||||
const getLatestMonth = () =>
|
||||
Loading…
Reference in New Issue
Block a user