mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-18 21:35:27 -04:00
34 lines
759 B
JavaScript
34 lines
759 B
JavaScript
import React from 'react';
|
|
import DescriptionList from 'Components/DescriptionList/DescriptionList';
|
|
import DescriptionListItem from 'Components/DescriptionList/DescriptionListItem';
|
|
|
|
function MediaInfo(props) {
|
|
return (
|
|
<DescriptionList>
|
|
{
|
|
Object.keys(props).map((key) => {
|
|
const title = key
|
|
.replace(/([A-Z])/g, ' $1')
|
|
.replace(/^./, (str) => str.toUpperCase());
|
|
|
|
const value = props[key];
|
|
|
|
if (!value) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<DescriptionListItem
|
|
key={key}
|
|
title={title}
|
|
data={props[key]}
|
|
/>
|
|
);
|
|
})
|
|
}
|
|
</DescriptionList>
|
|
);
|
|
}
|
|
|
|
export default MediaInfo;
|