* refactor: replace @edx/paragon and @edx/frontend-build * refactor: updated edx packages * fix: fixed failing test cases by remmoving paragon mock * fix: updated lock file to fix build issues --------- Co-authored-by: mashal-m <mashal.malik@arbisoft.com> Co-authored-by: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com> Co-authored-by: Muhammad Abdullah Waheed <abdullah.waheed@arbisoft.com>
39 lines
991 B
JavaScript
39 lines
991 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { Card, Collapsible } from '@openedx/paragon';
|
|
import FilePopoverContent from 'components/FilePopoverContent';
|
|
import FileInfo from './FileInfo';
|
|
|
|
import './FileCard.scss';
|
|
|
|
/**
|
|
* <FileCard />
|
|
*/
|
|
export const FileCard = ({ file, children }) => (
|
|
<Card className="file-card" key={file.name}>
|
|
<Collapsible
|
|
className="file-collapsible"
|
|
defaultOpen
|
|
title={<h3 className="file-card-title">{file.name}</h3>}
|
|
>
|
|
<div className="preview-panel" data-testid="preview-panel">
|
|
<FileInfo><FilePopoverContent {...file} /></FileInfo>
|
|
{children}
|
|
</div>
|
|
</Collapsible>
|
|
</Card>
|
|
);
|
|
FileCard.defaultProps = {
|
|
};
|
|
FileCard.propTypes = {
|
|
file: PropTypes.shape({
|
|
name: PropTypes.string.isRequired,
|
|
downloadUrl: PropTypes.string.isRequired,
|
|
description: PropTypes.string.isRequired,
|
|
}).isRequired,
|
|
children: PropTypes.node.isRequired,
|
|
};
|
|
|
|
export default FileCard;
|