{details !== null && (
<>
{details.title}
{details.type}
{details.has_api && (
)}
{settings && (
<>
{details.type === 'Account' && (
)}
>
)}
{active && activity !== null && (
<>
{live && (
)}
>
)}
{!active && (
{details.has_api
? 'Press play to start API'
: 'Open settings to add API key'}
)}
>
)}
>
);
}
export default PageDetails;
function PageActivity(props) {
const eventDate = (event) => {
if (event.followed_on) {
return event.followed_on;
}
if (event.subscribed_on) {
return event.subscribed_on;
}
};
const sortEvents = () => {
let sorted = [
...props.activity.followers.recent_followers,
...props.activity.subscribers.recent_subscribers,
].sort((a, b) => (eventDate(a) < eventDate(b) ? 1 : -1));
return sorted;
};
return (
<>
Followers:
{countString(props.activity.followers.num_followers)}
Subscribers:
{countString(props.activity.subscribers.num_subscribers)}