import { createSignal, For, Show } from 'solid-js' import { SharePopup, getShareUrl } from '../SharePopup' import { getDescription } from '../../../utils/meta' import { useLocalize } from '../../../context/localize' import { Popover } from '../../_shared/Popover' import { Icon } from '../../_shared/Icon' import styles from './AudioPlayer.module.scss' import { GrowingTextarea } from '../../_shared/GrowingTextarea' import MD from '../MD' import { MediaItem } from '../../../pages/types' import SimplifiedEditor from '../../Editor/SimplifiedEditor' type Props = { media: MediaItem[] currentTrackIndex: number isPlaying: boolean onPlayMedia: (trackIndex: number) => void articleSlug?: string body?: string editorMode?: boolean onMediaItemFieldChange?: (index: number, field: keyof MediaItem, value: string) => void onChangeMediaIndex?: (direction: 'up' | 'down', index) => void } export const PlayerPlaylist = (props: Props) => { const { t } = useLocalize() const [activeEditIndex, setActiveEditIndex] = createSignal(-1) const toggleDropDown = (index) => { setActiveEditIndex(activeEditIndex() === index ? -1 : index) } const handleMediaItemFieldChange = (field: keyof MediaItem, value: string) => { props.onMediaItemFieldChange(activeEditIndex(), field, value) } return ( ) }