mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-19 11:58:41 +08:00
14 lines
393 B
TypeScript
14 lines
393 B
TypeScript
import React from 'react';
|
|
import { SoundOutlined } from '@ant-design/icons';
|
|
|
|
const Audio: React.FC<React.PropsWithChildren<{ domId: string }>> = ({ domId, children }) => {
|
|
return (
|
|
<a onClick={() => document.querySelector<HTMLAudioElement>(`#${domId}`)?.play()}>
|
|
{children}
|
|
<SoundOutlined style={{ fontSize: 20, color: 'black' }} />
|
|
</a>
|
|
);
|
|
};
|
|
|
|
export default Audio;
|