botframework-webchat-component
Version:
React component of botframework-webchat
22 lines (15 loc) • 491 B
JavaScript
import { hooks } from 'botframework-webchat-api';
import PropTypes from 'prop-types';
import React from 'react';
const { useLocalizer } = hooks;
const FileAttachment = ({ attachment: { name = '' } = {} }) => {
const localize = useLocalizer();
const label = localize('ATTACHMENT_FILE', name);
return <article>{label}</article>;
};
FileAttachment.propTypes = {
attachment: PropTypes.shape({
name: PropTypes.string.isRequired
}).isRequired
};
export default FileAttachment;