import * as React from "react"; import { FooterProps } from "opds-web-client/lib/components/Root"; import { LinkData } from "opds-web-client/lib/interfaces"; export default class Footer extends React.Component { constructor(props) { super(props); this.links = this.links.bind(this); } links(): LinkData[] { let links = []; let labels = { "about": "About", "terms-of-service": "Terms of Service", "privacy-policy": "Privacy Policy", "copyright": "Copyright" }; Object.keys(labels).forEach(type => { let link = this.props.collection.links.find(link => link.type === type); if (link) { let linkWithLabel = Object.assign({}, link, { text: labels[type] }); links.push(linkWithLabel); } }); return links; } render(): JSX.Element { return ( ); } }