/* jshint ignore:start */ import React from 'react'; import { OptionsXs } from '../options'; export default function({category, isBusy, showOptions, isSelected, thread}) { let className = 'col-xs-12 col-sm-12'; if (showOptions) { if (thread.moderation.length) { className = 'col-xs-6 col-sm-12'; } else { className = 'col-xs-9 col-sm-12'; } } let statusFlags = 0; if (thread.is_hidden) statusFlags += 1; if (thread.is_closed) statusFlags += 1; if (thread.has_poll) statusFlags += 1; let allFlagsVisible = showOptions && statusFlags === 3; let textClassName = 'detail-text hidden-xs'; if (allFlagsVisible) { textClassName += ' hidden-sm' } return (
{category.name}
); } export function HiddenLabel({ display, textClassName }) { if (!display) return null; return ( visibility_off {gettext("Hidden")} ) } export function ClosedLabel({ display, textClassName }) { if (!display) return null; return ( lock_outline {gettext("Closed")} ) } export function PollLabel({ display, textClassName }) { if (!display) return null; return ( assessment {gettext("Poll")} ) } export function RepliesLabel({ replies, forceFullText }) { const text = ngettext( "%(replies)s reply", "%(replies)s replies", replies); let compactClassName = ''; let fullClassName = ''; if (forceFullText) { compactClassName = 'detail-text hide'; fullClassName = 'detail-text'; } else { compactClassName = 'detail-text visible-xs-inline-block'; fullClassName = 'detail-text hidden-xs'; } return ( forum {replies} {interpolate(text, { replies }, true)} ) } export function LastReplyLabel({ datetime, url }) { return ( {datetime.fromNow(true)} ) } export function LastPoster(props) { const { posterName, url } = props; if (url) { return ( {posterName} ); } return ( {posterName} ); }