2019-10-19 16:38:07 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
import { Repository } from '@scm-manager/ui-types';
|
|
|
|
|
import { MailLink, DateFromNow } from '@scm-manager/ui-components';
|
|
|
|
|
import { translate } from 'react-i18next';
|
2019-04-16 15:16:36 +02:00
|
|
|
|
|
|
|
|
type Props = {
|
2019-10-19 16:38:07 +02:00
|
|
|
repository: Repository;
|
2019-04-16 15:16:36 +02:00
|
|
|
// context props
|
2019-10-19 16:38:07 +02:00
|
|
|
t: (p: string) => string;
|
2019-04-16 15:16:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class RepositoryDetailTable extends React.Component<Props> {
|
|
|
|
|
render() {
|
|
|
|
|
const { repository, t } = this.props;
|
|
|
|
|
return (
|
|
|
|
|
<table className="table">
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
2019-10-19 16:38:07 +02:00
|
|
|
<th>{t('repository.name')}</th>
|
2019-04-16 15:16:36 +02:00
|
|
|
<td>{repository.name}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
2019-10-19 16:38:07 +02:00
|
|
|
<th>{t('repository.type')}</th>
|
2019-04-16 15:16:36 +02:00
|
|
|
<td>{repository.type}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
2019-10-19 16:38:07 +02:00
|
|
|
<th>{t('repository.contact')}</th>
|
2019-04-16 15:16:36 +02:00
|
|
|
<td>
|
|
|
|
|
<MailLink address={repository.contact} />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
2019-10-19 16:38:07 +02:00
|
|
|
<th>{t('repository.description')}</th>
|
2019-04-16 15:16:36 +02:00
|
|
|
<td>{repository.description}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
2019-10-19 16:38:07 +02:00
|
|
|
<th>{t('repository.creationDate')}</th>
|
2019-04-16 15:16:36 +02:00
|
|
|
<td>
|
|
|
|
|
<DateFromNow date={repository.creationDate} />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
2019-10-19 16:38:07 +02:00
|
|
|
<th>{t('repository.lastModified')}</th>
|
2019-04-16 15:16:36 +02:00
|
|
|
<td>
|
|
|
|
|
<DateFromNow date={repository.lastModified} />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-19 16:38:07 +02:00
|
|
|
export default translate('repos')(RepositoryDetailTable);
|