lemmy-ui/src/shared/components/home/legal.tsx

41 lines
1 KiB
TypeScript
Raw Normal View History

import { setIsoData } from "@utils/app";
import { Component } from "inferno";
import { GetSiteResponse } from "lemmy-js-client";
import { mdToHtml } from "../../markdown";
2023-06-22 00:54:35 +00:00
import { I18NextService } from "../../services";
import { HtmlTags } from "../common/html-tags";
interface LegalState {
siteRes: GetSiteResponse;
}
export class Legal extends Component<any, LegalState> {
private isoData = setIsoData(this.context);
state: LegalState = {
siteRes: this.isoData.site_res,
};
constructor(props: any, context: any) {
super(props, context);
}
get documentTitle(): string {
2023-06-22 00:54:35 +00:00
return I18NextService.i18n.t("legal_information");
}
render() {
2023-06-05 21:31:12 +00:00
const legal = this.state.siteRes.site_view.local_site.legal_information;
return (
2023-06-20 18:46:16 +00:00
<div className="legal container-lg">
<HtmlTags
title={this.documentTitle}
path={this.context.router.route.match.url}
/>
{legal && (
<div className="md-div" dangerouslySetInnerHTML={mdToHtml(legal)} />
)}
</div>
);
}
}