import React from 'react';
import { format } from 'timeago.js';
import { formatViewsNumber, imageExtension } from '../../../../utils/helpers/';
import { VideoPlayerByPageLink } from '../../../video-player/VideoPlayerByPageLink';
import { translateString } from '../../../../utils/helpers/';
export function ItemDescription(props) {
return '' === props.description ? null : (
);
}
export function ItemMain(props) {
return {props.children}
;
}
export function ItemMainInLink(props) {
return (
{props.children}
);
}
export function ItemTitle(props) {
return '' === props.title ? null : (
{props.title}
);
}
export function ItemTitleLink(props) {
return '' === props.title ? null : (
);
}
export function UserItemMemberSince(props) {
return ;
}
export function TaxonomyItemMediaCount(props) {
return (
{' ' + props.count} media
);
}
export function PlaylistItemMetaDate(props) {
return (
);
}
export function MediaItemEditLink(props) {
let link = props.link;
if (link && window.MediaCMS.site.devEnv) {
link = '/edit-media.html';
}
return !link ? null : (
{translateString("EDIT MEDIA")}
);
}
export function MediaItemThumbnailLink(props) {
const attr = {
key: 'item-thumb',
href: props.link,
title: props.title,
tabIndex: '-1',
'aria-hidden': true,
className: 'item-thumb' + (!props.src ? ' no-thumb' : ''),
style: !props.src ? null : { backgroundImage: "url('" + props.src + "')" },
};
return (
{!props.src ? null : (
)}
);
}
export function UserItemThumbnailLink(props) {
const attr = {
key: 'item-thumb',
href: props.link,
title: props.title,
tabIndex: '-1',
'aria-hidden': true,
className: 'item-thumb' + (!props.src ? ' no-thumb' : ''),
style: !props.src ? null : { backgroundImage: "url('" + props.src + "')" },
};
return ;
}
export function MediaItemAuthor(props) {
return '' === props.name ? null : (
{props.name}
);
}
export function MediaItemAuthorLink(props) {
return '' === props.name ? null : (
{props.name}
);
}
export function MediaItemMetaViews(props) {
return (
{formatViewsNumber(props.views) + ' ' + (1 >= props.views ? translateString('view') : translateString('views'))}
);
}
export function MediaItemMetaDate(props) {
return (
);
}
export function MediaItemDuration(props) {
return (
{props.text}
);
}
export function MediaItemVideoPreviewer(props) {
if ('' === props.url) {
return null;
}
const src = props.url.split('.').slice(0, -1).join('.');
const ext = imageExtension(props.url);
return ;
}
export function MediaItemVideoPlayer(props) {
return (
);
}
export function MediaItemPlaylistIndex(props) {
return (
{props.inPlayback && props.index === props.activeIndex ? (
play_arrow
) : (
props.index
)}
);
}