Update components/playlist/PlaylistItem.tsx
Browse files
components/playlist/PlaylistItem.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import React, { FC, useEffect, useState, useRef } from "react"
|
| 2 |
-
import { Draggable } from "
|
| 3 |
import classNames from "classnames"
|
| 4 |
import { MediaElement } from "../../lib/types"
|
| 5 |
import NewTabLink from "../action/NewTabLink"
|
|
@@ -12,6 +12,9 @@ import IconPlay from "../icon/IconPlay"
|
|
| 12 |
import IconDisk from "../icon/IconDisk"
|
| 13 |
import { getDomain } from "../../lib/utils"
|
| 14 |
|
|
|
|
|
|
|
|
|
|
| 15 |
interface Props {
|
| 16 |
playing: boolean
|
| 17 |
item: MediaElement
|
|
@@ -112,18 +115,23 @@ const PlaylistItem: FC<Props> = ({
|
|
| 112 |
}}
|
| 113 |
interaction={() => {}}
|
| 114 |
>
|
| 115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
</ControlButton>
|
| 117 |
-
<
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
>
|
| 123 |
-
|
| 124 |
-
<IconNewTab />
|
| 125 |
-
</NewTabLink>
|
| 126 |
-
</div>
|
| 127 |
</div>
|
| 128 |
</div>
|
| 129 |
)}
|
|
|
|
| 1 |
import React, { FC, useEffect, useState, useRef } from "react"
|
| 2 |
+
import { Draggable as _Draggable, DraggableProps } from "react-beautiful-dnd"
|
| 3 |
import classNames from "classnames"
|
| 4 |
import { MediaElement } from "../../lib/types"
|
| 5 |
import NewTabLink from "../action/NewTabLink"
|
|
|
|
| 12 |
import IconDisk from "../icon/IconDisk"
|
| 13 |
import { getDomain } from "../../lib/utils"
|
| 14 |
|
| 15 |
+
// HACK: this fixes type incompatibility
|
| 16 |
+
const Draggable = _Draggable as unknown as FC<DraggableProps>
|
| 17 |
+
|
| 18 |
interface Props {
|
| 19 |
playing: boolean
|
| 20 |
item: MediaElement
|
|
|
|
| 115 |
}}
|
| 116 |
interaction={() => {}}
|
| 117 |
>
|
| 118 |
+
{playing ? (
|
| 119 |
+
<IconDisk
|
| 120 |
+
className={"animate-spin animate-pulse text-purple-700"}
|
| 121 |
+
/>
|
| 122 |
+
) : (
|
| 123 |
+
<IconPlay
|
| 124 |
+
className={"text-primary-900 hover:text-primary-900"}
|
| 125 |
+
/>
|
| 126 |
+
)}
|
| 127 |
</ControlButton>
|
| 128 |
+
<NewTabLink
|
| 129 |
+
href={item.src[0].src}
|
| 130 |
+
className={"flex flex-row gap-1"}
|
| 131 |
+
>
|
| 132 |
+
<div className={"line-clamp-2"}>{getDomain(item.src[0].src)}</div>
|
| 133 |
+
<IconNewTab className={"shrink-0"} />
|
| 134 |
+
</NewTabLink>
|
|
|
|
|
|
|
|
|
|
| 135 |
</div>
|
| 136 |
</div>
|
| 137 |
)}
|