diff --git a/src/features/album/components/AlbumTrackList.tsx b/src/features/album/components/AlbumTrackList.tsx index 943e01fa..0b548bb6 100644 --- a/src/features/album/components/AlbumTrackList.tsx +++ b/src/features/album/components/AlbumTrackList.tsx @@ -1,7 +1,7 @@ import type { SubsonicSong } from '@/lib/api/subsonicTypes'; import type { Track } from '@/lib/media/trackTypes'; import React, { useMemo, useState, useEffect } from 'react'; -import { useTracklistColumns } from '@/utils/useTracklistColumns'; +import { useTracklistColumns } from '@/hooks/useTracklistColumns'; import { usePlayerStore } from '@/features/playback/store/playerStore'; import { useTranslation } from 'react-i18next'; import { useIsMobile } from '@/lib/hooks/useIsMobile'; diff --git a/src/features/album/components/TrackRow.tsx b/src/features/album/components/TrackRow.tsx index 42ea0fe7..191b007e 100644 --- a/src/features/album/components/TrackRow.tsx +++ b/src/features/album/components/TrackRow.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { AudioLines, ChevronRight, Heart, Play, Square } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; -import type { ColDef } from '@/utils/useTracklistColumns'; +import type { ColDef } from '@/hooks/useTracklistColumns'; import type { SubsonicSong } from '@/lib/api/subsonicTypes'; import type { Track } from '@/lib/media/trackTypes'; import { songToTrack } from '@/lib/media/songToTrack'; diff --git a/src/features/album/components/TracklistHeaderRow.tsx b/src/features/album/components/TracklistHeaderRow.tsx index de3bcb44..49a6977e 100644 --- a/src/features/album/components/TracklistHeaderRow.tsx +++ b/src/features/album/components/TracklistHeaderRow.tsx @@ -1,6 +1,6 @@ import React from 'react'; import type { TFunction } from 'i18next'; -import type { ColDef } from '@/utils/useTracklistColumns'; +import type { ColDef } from '@/hooks/useTracklistColumns'; import { CENTERED_COLS, isSortable, type ColKey, type SortKey } from '@/features/album/utils/albumTrackListHelpers'; interface Props { diff --git a/src/features/album/utils/albumTrackListHelpers.ts b/src/features/album/utils/albumTrackListHelpers.ts index e360b2f5..87124e00 100644 --- a/src/features/album/utils/albumTrackListHelpers.ts +++ b/src/features/album/utils/albumTrackListHelpers.ts @@ -1,4 +1,4 @@ -import type { ColDef } from '@/utils/useTracklistColumns'; +import type { ColDef } from '@/hooks/useTracklistColumns'; export function codecLabel(song: { suffix?: string; bitRate?: number }, showBitrate: boolean): string { const parts: string[] = []; diff --git a/src/features/favorites/components/FavoriteSongRow.tsx b/src/features/favorites/components/FavoriteSongRow.tsx index e8a25cbd..d5513626 100644 --- a/src/features/favorites/components/FavoriteSongRow.tsx +++ b/src/features/favorites/components/FavoriteSongRow.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import { AudioLines, ChevronRight, Play, Square, X } from 'lucide-react'; -import type { ColDef } from '@/utils/useTracklistColumns'; +import type { ColDef } from '@/hooks/useTracklistColumns'; import type { SubsonicSong } from '@/lib/api/subsonicTypes'; import { codecLabel } from '@/utils/componentHelpers/playlistDetailHelpers'; import { formatLastSeen } from '@/utils/componentHelpers/userMgmtHelpers'; diff --git a/src/features/favorites/components/FavoritesSongsTracklist.tsx b/src/features/favorites/components/FavoritesSongsTracklist.tsx index c8fbf6f9..6bc77524 100644 --- a/src/features/favorites/components/FavoritesSongsTracklist.tsx +++ b/src/features/favorites/components/FavoritesSongsTracklist.tsx @@ -4,7 +4,7 @@ import FavoriteSongRow, { type FavoriteSongRowCallbacks } from '@/features/favor import { TracklistColumnPicker } from '@/ui/TracklistColumnPicker'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; -import type { ColDef } from '@/utils/useTracklistColumns'; +import type { ColDef } from '@/hooks/useTracklistColumns'; import type { SubsonicSong } from '@/lib/api/subsonicTypes'; import { usePlayerStore } from '@/features/playback/store/playerStore'; import { previewInputFromSong, usePreviewStore } from '@/features/playback/store/previewStore'; diff --git a/src/features/favorites/pages/Favorites.tsx b/src/features/favorites/pages/Favorites.tsx index f75882cf..7617746d 100644 --- a/src/features/favorites/pages/Favorites.tsx +++ b/src/features/favorites/pages/Favorites.tsx @@ -1,6 +1,6 @@ import { queueSongStar, queueSongRating } from '@/features/playback/store/pendingStarSync'; import React, { useEffect, useMemo, useState } from 'react'; -import { useTracklistColumns, type ColDef } from '@/utils/useTracklistColumns'; +import { useTracklistColumns, type ColDef } from '@/hooks/useTracklistColumns'; import { TopFavoriteArtistsRow } from '@/features/favorites/components/TopFavoriteArtists'; import { RadioStationRow } from '@/features/favorites/components/RadioFavorites'; import FavoritesSongsSectionHeader from '@/features/favorites/components/FavoritesSongsSectionHeader'; diff --git a/src/features/playlist/components/PlaylistRow.tsx b/src/features/playlist/components/PlaylistRow.tsx index 5d58151c..60f57570 100644 --- a/src/features/playlist/components/PlaylistRow.tsx +++ b/src/features/playlist/components/PlaylistRow.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import { AudioLines, ChevronRight, Heart, Play, Square, Trash2 } from 'lucide-react'; -import type { ColDef } from '@/utils/useTracklistColumns'; +import type { ColDef } from '@/hooks/useTracklistColumns'; import type { SubsonicSong } from '@/lib/api/subsonicTypes'; import { codecLabel } from '@/utils/componentHelpers/playlistDetailHelpers'; import { formatLastSeen } from '@/utils/componentHelpers/userMgmtHelpers'; diff --git a/src/features/playlist/components/PlaylistSuggestions.tsx b/src/features/playlist/components/PlaylistSuggestions.tsx index afa901ec..c20bded9 100644 --- a/src/features/playlist/components/PlaylistSuggestions.tsx +++ b/src/features/playlist/components/PlaylistSuggestions.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; import { ChevronRight, Heart, Play, Plus, RefreshCw, Square } from 'lucide-react'; -import type { ColDef } from '@/utils/useTracklistColumns'; +import type { ColDef } from '@/hooks/useTracklistColumns'; import type { SubsonicSong } from '@/lib/api/subsonicTypes'; import { usePlayerStore } from '@/features/playback/store/playerStore'; import { usePreviewStore } from '@/features/playback/store/previewStore'; diff --git a/src/features/playlist/components/PlaylistTracklist.tsx b/src/features/playlist/components/PlaylistTracklist.tsx index e2c9d472..9f94d991 100644 --- a/src/features/playlist/components/PlaylistTracklist.tsx +++ b/src/features/playlist/components/PlaylistTracklist.tsx @@ -9,7 +9,7 @@ import { useNavigate } from 'react-router-dom'; import { ListPlus, Search, Trash2, X, } from 'lucide-react'; -import type { ColDef } from '@/utils/useTracklistColumns'; +import type { ColDef } from '@/hooks/useTracklistColumns'; import type { SubsonicSong } from '@/lib/api/subsonicTypes'; import type { Track } from '@/lib/media/trackTypes'; import { usePlayerStore } from '@/features/playback/store/playerStore'; diff --git a/src/features/playlist/pages/PlaylistDetail.tsx b/src/features/playlist/pages/PlaylistDetail.tsx index f5b91c28..03749fcc 100644 --- a/src/features/playlist/pages/PlaylistDetail.tsx +++ b/src/features/playlist/pages/PlaylistDetail.tsx @@ -2,7 +2,7 @@ import { updatePlaylist } from '@/lib/api/subsonicPlaylists'; import type { SubsonicPlaylist, SubsonicSong } from '@/lib/api/subsonicTypes'; import React, { useEffect, useState, useCallback, useMemo } from 'react'; import { useParams, useNavigate, useLocation } from 'react-router-dom'; -import { useTracklistColumns, type ColDef } from '@/utils/useTracklistColumns'; +import { useTracklistColumns, type ColDef } from '@/hooks/useTracklistColumns'; import { usePlayerStore } from '@/features/playback/store/playerStore'; import { useShallow } from 'zustand/react/shallow'; import { usePlaylistStore } from '@/features/playlist/store/playlistStore'; diff --git a/src/utils/useTracklistColumns.ts b/src/hooks/useTracklistColumns.ts similarity index 100% rename from src/utils/useTracklistColumns.ts rename to src/hooks/useTracklistColumns.ts diff --git a/src/ui/TracklistColumnPicker.test.tsx b/src/ui/TracklistColumnPicker.test.tsx index 3c4098ac..c4501803 100644 --- a/src/ui/TracklistColumnPicker.test.tsx +++ b/src/ui/TracklistColumnPicker.test.tsx @@ -5,7 +5,7 @@ import userEvent from '@testing-library/user-event'; import type { TFunction } from 'i18next'; import { renderWithProviders } from '@/test/helpers/renderWithProviders'; import { TracklistColumnPicker } from '@/ui/TracklistColumnPicker'; -import type { ColDef } from '@/utils/useTracklistColumns'; +import type { ColDef } from '@/hooks/useTracklistColumns'; const COLUMNS: readonly ColDef[] = [ { key: 'title', i18nKey: 'title', minWidth: 100, defaultWidth: 200, required: true }, diff --git a/src/ui/TracklistColumnPicker.tsx b/src/ui/TracklistColumnPicker.tsx index c96a2464..5b193021 100644 --- a/src/ui/TracklistColumnPicker.tsx +++ b/src/ui/TracklistColumnPicker.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useLayoutEffect, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; import { Check, ChevronDown, RotateCcw } from 'lucide-react'; import type { TFunction } from 'i18next'; -import type { ColDef } from '@/utils/useTracklistColumns'; +import type { ColDef } from '@/hooks/useTracklistColumns'; interface Props { /** Every column (required ones are filtered out of the menu). */