Files
frontend-app-ora-grading/src/components/FilePreview/FileInfo.jsx
Mashal Malik f67ffdd480 refactor: replace @edx/paragon and @edx/frontend-build (#294)
* 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>
2024-02-28 13:04:23 -03:00

51 lines
1.1 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import {
Button,
OverlayTrigger,
Popover,
} from '@openedx/paragon';
import { InfoOutline } from '@openedx/paragon/icons';
import { FormattedMessage } from '@edx/frontend-platform/i18n';
import { nullMethod } from 'hooks';
import messages from './messages';
/**
* <FileInfo />
*/
export const FileInfo = ({ onClick, children }) => (
<OverlayTrigger
trigger="focus"
placement="right-end"
flip
overlay={(
<Popover id="file-popover" className="overlay-help-popover">
<Popover.Content>{children}</Popover.Content>
</Popover>
)}
>
<Button
size="sm"
variant="tertiary"
onClick={onClick}
iconAfter={InfoOutline}
>
<FormattedMessage {...messages.fileInfo} />
</Button>
</OverlayTrigger>
);
FileInfo.defaultProps = {
onClick: nullMethod,
};
FileInfo.propTypes = {
onClick: PropTypes.func,
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node,
]).isRequired,
};
export default FileInfo;