hunk.code_window: exports[`components/FileInfoPreview should match snapshot, can download files 1`] = `
   <div
     className="file-details__container"
   >
     <ExternalLink
       className="file-details__preview"
       href="https://pre-release.mattermost.com/api/v4/files/rqir81f7a7ft8m6j6ej7g1txuo"
  
hunk.labels: keep keep keep keep keep replace keep keep
hunk.after_edit:   <a
  
hunk.file_path: webapp/channels/src/components/file_info_preview/__snapshots__/file_info_preview.test.tsx.snap
hunk.type: replace
file: // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
  // See LICENSE.txt for license information.
  
  import React from 'react';
  
  import type {FileInfo} from '@mattermost/types/files';
  
  import ExternalLink from 'components/external_link';
  
  import * as Utils from 'utils/utils';
  
  type Props = {
      fileInfo: FileInfo;
      fileUrl: string;
      canDownloadFiles: boolean;
  };
  
  export default class FileInfoPreview extends React.PureComponent<Props> {
      render() {
          const fileInfo = this.props.fileInfo;
          const fileUrl = this.props.fileUrl;
  
          // non-image files include a section providing details about the file
          const infoParts = [];
  
          if (fileInfo.extension !== '') {
              infoParts.push(Utils.localizeMessage('file_info_preview.type', 'File type ') + fileInfo.extension.toUpperCase());
          }
  
          if (fileInfo.size) {
              infoParts.push(Utils.localizeMessage('file_info_preview.size', 'Size ') + Utils.fileSizeToString(fileInfo.size));
          }
  
          const infoString = infoParts.join(', ');
  
          let preview = null;
          if (this.props.canDownloadFiles) {
              preview = (
                  <ExternalLink
                      className='file-details__preview'
                      href={fileUrl}
                      location='file_info_preview'
                  >
                      <span className='file-details__preview-helper'/>
                      <img
                          alt={'file preview'}
                          src={Utils.getFileIconPath(fileInfo)}
                      />
                  </ExternalLink>
              );
          } else {
              preview = (
                  <span className='file-details__preview'>
                      <span className='file-details__preview-helper'/>
                      <img
                          alt={'file preview'}
                          src={Utils.getFileIconPath(fileInfo)}
                      />
                  </span>
              );
          }
  
          return (
              <div className='file-details__container'>
                  {preview}
                  <div className='file-details'>
                      <div className='file-details__name'>{fileInfo.name}</div>
                      <div className='file-details__info'>{infoString}</div>
                  </div>
              </div>
          );
      }
  }
  