import React, { forwardRef, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import Icon from '@stremio/stremio-icons/react'; import { Button, MultiselectMenu } from 'stremio/components'; import { useToast } from 'stremio/common'; import { Section, Option } from '../components'; import URLsManager from './URLsManager'; import useStreamingOptions from './useStreamingOptions'; import styles from './Streaming.less'; type Props = { profile: Profile, streamingServer: StreamingServer, }; const Streaming = forwardRef(({ profile, streamingServer }: Props, ref) => { const { t } = useTranslation(); const toast = useToast(); const { streamingServerRemoteUrlInput, remoteEndpointSelect, cacheSizeSelect, torrentProfileSelect, transcodingProfileSelect, } = useStreamingOptions(streamingServer); const onCopyRemoteUrl = useCallback(() => { if (streamingServer.remoteUrl) { navigator.clipboard.writeText(streamingServer.remoteUrl); toast.show({ type: 'success', title: t('SETTINGS_REMOTE_URL_COPIED'), timeout: 2500, }); } }, [streamingServer.remoteUrl]); return (
{ streamingServerRemoteUrlInput.value !== null && } { profile.auth !== null && profile.auth.user !== null && remoteEndpointSelect !== null && } { cacheSizeSelect !== null && } { torrentProfileSelect !== null && } { transcodingProfileSelect !== null && }
); }); export default Streaming;