2019-10-20 18:02:52 +02:00
|
|
|
import React from "react";
|
2019-10-23 15:47:08 +02:00
|
|
|
import { WithTranslation, withTranslation } from "react-i18next";
|
2019-10-20 18:02:52 +02:00
|
|
|
import { File } from "@scm-manager/ui-types";
|
|
|
|
|
import { DownloadButton } from "@scm-manager/ui-components";
|
2019-10-19 16:38:07 +02:00
|
|
|
|
2019-10-23 15:47:08 +02:00
|
|
|
type Props = WithTranslation & {
|
2019-10-19 16:38:07 +02:00
|
|
|
file: File;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class DownloadViewer extends React.Component<Props> {
|
|
|
|
|
render() {
|
|
|
|
|
const { t, file } = this.props;
|
|
|
|
|
return (
|
|
|
|
|
<div className="has-text-centered">
|
2019-10-21 10:57:56 +02:00
|
|
|
<DownloadButton url={file._links.self.href} displayName={t("sources.content.downloadButton")} />
|
2019-10-19 16:38:07 +02:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-23 15:47:08 +02:00
|
|
|
export default withTranslation("repos")(DownloadViewer);
|