import { Link } from "inferno-router";
import {
CommunityAggregates,
- CommunityView,
+ CommunityId,
SiteAggregates,
} from "lemmy-js-client";
import { i18n } from "../../i18next";
interface BadgesProps {
counts: CommunityAggregates | SiteAggregates;
- community_view: CommunityView;
+ communityId?: CommunityId;
}
const isCommunityAggregates = (
return "communities" in counts;
};
-export const Badges = ({ counts, community_view }: BadgesProps) => {
+export const Badges = ({ counts, communityId }: BadgesProps) => {
return (
<ul className="my-1 list-inline">
<li
<li className="list-inline-item">
<Link
className="badge badge-primary"
- to={`/modlog${
- community_view ? `/${community_view.community.id}` : ""
- }`}
+ to={`/modlog${communityId ? `/${communityId}` : ""}`}
>
{i18n.t("modlog")}
</Link>
<div className="card-body">
{this.description()}
<Badges
- community_view={this.props.community_view}
+ communityId={this.props.community_view.community.id}
counts={this.props.community_view.counts}
/>
{this.mods()}