teableio/teable

View on GitHub
packages/ui-lib/src/base/file/preview/audio/AudioPreview.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import type { IFileItemInner } from '../FilePreviewContext';

interface IAudioPreview extends IFileItemInner {}

export const AudioPreview = (props: IAudioPreview) => {
  const { src, name, downloadUrl } = props;
  return (
    <audio className="max-h-full max-w-full" controls src={src}>
      <track kind="captions" default />
      {downloadUrl && (
        <a href={downloadUrl} download={name}>
          Download audio
        </a>
      )}
    </audio>
  );
};