Ignore:
Timestamp:
02/10/26 21:58:39 (5 months ago)
Author:
Filip Gavrilovski <filipgavrilovski28@…>
Branches:
main
Children:
92db381
Parents:
0808ef2
Message:

refactor artist, collection, listener components to have similar style as other components; refactor some dto-s

File:
1 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/components/Sidebar.tsx

    r0808ef2 r1579b4f  
    55import { usePlayer } from "../context/playerContext";
    66import type { BasicPlaylist, BasicSong, SidebarProps } from "../utils/types";
    7 
    8 const toEmbedUrl = (url: string): string => {
    9         try {
    10                 const parsed = new URL(url);
    11                 if (
    12                         (parsed.hostname === "www.youtube.com" ||
    13                                 parsed.hostname === "youtube.com") &&
    14                         parsed.searchParams.has("v")
    15                 ) {
    16                         return `https://www.youtube.com/embed/${parsed.searchParams.get("v")}`;
    17                 }
    18                 if (parsed.hostname === "youtu.be") {
    19                         return `https://www.youtube.com/embed${parsed.pathname}`;
    20                 }
    21                 return url;
    22         } catch {
    23                 return url;
    24         }
    25 };
     7import { toEmbedUrl } from "../utils/utils";
    268
    279const Sidebar = ({ isOpen, onClose }: SidebarProps) => {
Note: See TracChangeset for help on using the changeset viewer.