| 1 | import { type TAudioElement } from "platejs"; |
| 2 | import { SlateElement, type SlateElementProps } from "platejs/static"; |
| 3 | |
| 4 | export function AudioElementStatic(props: SlateElementProps<TAudioElement>) { |
| 5 | return ( |
| 6 | <SlateElement {...props} className="mb-1"> |
| 7 | <figure className="group relative cursor-default"> |
| 8 | <div className="h-16"> |
| 9 | <audio |
| 10 | aria-label="media audio node static control" |
| 11 | className="size-full" |
| 12 | src={props.element.url} |
| 13 | controls |
| 14 | > |
| 15 | <track kind="captions" src="data:text/vtt,WEBVTT%0A" /> |
| 16 | </audio> |
| 17 | </div> |
| 18 | </figure> |
| 19 | {props.children} |
| 20 | </SlateElement> |
| 21 | ); |
| 22 | } |
| 23 |