refactor: move to tanstack router

This commit is contained in:
Prayag Prajapati committed 2024-05-29 18:10:22 +05:30
1 parent a4ea932153
commit 522621ed69
136 files changed
+7063 -6127

No files matched your search

+2 -2
View File
@@ -1,12 +1,12 @@
import Typography from "@mui/material/Typography";
import React from "react";
import { getRuntimeMusic } from "../../utils/date/time";
import { useApi } from "../../utils/store/api";
import { useAudioPlayback } from "../../utils/store/audioPlayback";
import LikeButton from "../buttons/likeButton";
import PlayButton from "../buttons/playButton";
import TextLink from "../textLink";
import "./musicTrack.scss";
import { useRouteContext } from "@tanstack/react-router";
/**
* @typedef {Object} Props
@@ -33,7 +33,7 @@ const MusicTrack = ({
trackIndex,
className = "",
}) => {
const [api] = useApi((state) => [state.api]);
const api = useRouteContext({ from: "/" }).api;
const [currentTrackItem] = useAudioPlayback((state) => [state.item]);
return (