File tree Expand file tree Collapse file tree 4 files changed +47
-33
lines changed Expand file tree Collapse file tree 4 files changed +47
-33
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,7 @@ import { SideBySide } from './lib/tags/side-by-side.component';
37
37
import { sideBySide } from './lib/tags/side-by-side.schema' ;
38
38
import { Tab , Tabs } from './lib/tags/tabs.component' ;
39
39
import { tab , tabs } from './lib/tags/tabs.schema' ;
40
- import { YouTube } from './lib/tags/youtube.components' ;
41
- import { youtube } from './lib/tags/youtube.schema' ;
40
+ import { YouTube , youtube } from './lib/tags/youtube.component' ;
42
41
import {
43
42
TerminalCommand ,
44
43
terminalCommand ,
Original file line number Diff line number Diff line change
1
+ import { Schema } from '@markdoc/markdoc' ;
2
+
3
+ export const youtube : Schema = {
4
+ render : 'YouTube' ,
5
+ attributes : {
6
+ src : {
7
+ type : 'String' ,
8
+ required : true ,
9
+ } ,
10
+ title : {
11
+ type : 'String' ,
12
+ required : true ,
13
+ } ,
14
+ width : {
15
+ type : 'String' ,
16
+ default : '50%' ,
17
+ } ,
18
+ caption : {
19
+ // Added caption attribute here
20
+ type : 'String' ,
21
+ required : false , // Not required since it's optional
22
+ } ,
23
+ } ,
24
+ } ;
25
+
26
+ export function YouTube ( props : any ) : JSX . Element {
27
+ return (
28
+ < div className = "text-center" >
29
+ { ' ' }
30
+ { /* Center alignment applied to the container */ }
31
+ < iframe
32
+ { ...props }
33
+ title = { props . title }
34
+ width = { props . width || '50%' }
35
+ allow = "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; fullscreen"
36
+ loading = "lazy"
37
+ className = "rounded-lg shadow-lg mb-1"
38
+ />
39
+ { props . caption && (
40
+ < p className = "w-1/2 mx-auto pt-0 text-slate-500 dark:text-slate-400" >
41
+ { props . caption }
42
+ </ p >
43
+ ) }
44
+ </ div >
45
+ ) ;
46
+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments