refactor: remove unused imports and redundant code in MusicPlayer and AppLayout components
This commit is contained in:
@@ -2,7 +2,6 @@ import { PageHeader } from '@/components/PageHeader'
|
||||
import { AppSidebar } from '@/components/sidebar/AppSidebar'
|
||||
import { SidebarProvider, SidebarInset } from '@/components/ui/sidebar'
|
||||
import { MusicPlayer } from '@/components/MusicPlayer'
|
||||
import { useMusicPlayer } from '@/contexts/MusicPlayerContext'
|
||||
import { type ReactNode } from 'react'
|
||||
|
||||
interface AppLayoutProps {
|
||||
|
||||
@@ -56,12 +56,6 @@ export function MusicPlayer() {
|
||||
return null
|
||||
}
|
||||
|
||||
const formatTime = (seconds: number) => {
|
||||
const mins = Math.floor(seconds / 60)
|
||||
const secs = Math.floor(seconds % 60)
|
||||
return `${mins}:${secs.toString().padStart(2, '0')}`
|
||||
}
|
||||
|
||||
const handleVolumeChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const newVolume = parseFloat(e.target.value)
|
||||
setVolume(newVolume)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createContext, useContext, useState, useRef, useEffect, type ReactNode } from 'react'
|
||||
import { createContext, useContext, useState, useEffect, type ReactNode } from 'react'
|
||||
import { useSocket } from './SocketContext'
|
||||
import { apiService } from '@/services/api'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Play, Square, Volume2, Plus, Clock, Weight } from 'lucide-react';
|
||||
import { Play, Square, Plus, Clock, Weight } from 'lucide-react';
|
||||
import { toast } from 'sonner';
|
||||
import { apiService } from '@/services/api';
|
||||
import { AddUrlDialog } from '@/components/AddUrlDialog';
|
||||
|
||||
Reference in New Issue
Block a user