webamp/src/upload/UploadSection.js
2020-09-15 22:36:52 -07:00

34 lines
677 B
JavaScript

import React from "react";
import UploadRow from "./UploadRow";
function UploadSection({ files, title, extra }) {
if (files.length === 0) {
return null;
}
return (
<div
style={{
paddingBottom: 20,
}}
>
<div
style={{
display: "flex",
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center",
}}
>
<h2>
{title} ({files.length.toLocaleString()})
</h2>
<div>{extra}</div>
</div>
{files.map((file) => (
<UploadRow key={file.id} file={file} />
))}
</div>
);
}
export default UploadSection;