import { Card, UncontrolledTooltip } from 'reactstrap'; import Moment from 'react-moment'; import React from 'react'; import { ExternalLink } from 'react-external-link'; import ShortUrlVisitsCount from '../short-urls/helpers/ShortUrlVisitsCount'; import { shortUrlDetailType } from './reducers/shortUrlDetail'; import { shortUrlVisitsType } from './reducers/shortUrlVisits'; import './VisitsHeader.scss'; const propTypes = { shortUrlDetail: shortUrlDetailType.isRequired, shortUrlVisits: shortUrlVisitsType.isRequired, }; export default function VisitsHeader({ shortUrlDetail, shortUrlVisits }) { const { shortUrl, loading } = shortUrlDetail; const { visits } = shortUrlVisits; const shortLink = shortUrl && shortUrl.shortUrl ? shortUrl.shortUrl : ''; const longLink = shortUrl && shortUrl.longUrl ? shortUrl.longUrl : ''; const renderDate = () => ( {shortUrl.dateCreated} {shortUrl.dateCreated} ); return (

Visits:{' '} Visit stats for


Created: {renderDate()}
Long URL:{' '} {loading && Loading...} {!loading && }
); } VisitsHeader.propTypes = propTypes;