1
- import { MdOutlineContentPasteGo } from "react-icons/md" ;
1
+ import { MdOutlineContentPasteGo , MdOutlineDocumentScanner } from "react-icons/md" ;
2
2
import { LuCable , LuHardDrive , LuMaximize , LuSettings , LuSignal } from "react-icons/lu" ;
3
3
import { FaKeyboard } from "react-icons/fa6" ;
4
4
import { Popover , PopoverButton , PopoverPanel } from "@headlessui/react" ;
@@ -19,11 +19,14 @@ import WakeOnLanModal from "@/components/popovers/WakeOnLan/Index";
19
19
import MountPopopover from "@/components/popovers/MountPopover" ;
20
20
import ExtensionPopover from "@/components/popovers/ExtensionPopover" ;
21
21
import { useDeviceUiNavigation } from "@/hooks/useAppNavigation" ;
22
+ import OCRModal from "./popovers/OCRModal" ;
22
23
23
24
export default function Actionbar ( {
24
25
requestFullscreen,
26
+ videoElmRef,
25
27
} : {
26
28
requestFullscreen : ( ) => Promise < void > ;
29
+ videoElmRef ?: React . RefObject < HTMLVideoElement | null > ;
27
30
} ) {
28
31
const { navigateTo } = useDeviceUiNavigation ( ) ;
29
32
const { isVirtualKeyboardEnabled, setVirtualKeyboardEnabled } = useHidStore ( ) ;
@@ -99,6 +102,36 @@ export default function Actionbar({
99
102
} }
100
103
</ PopoverPanel >
101
104
</ Popover >
105
+ < Popover >
106
+ < PopoverButton as = { Fragment } >
107
+ < Button
108
+ size = "XS"
109
+ theme = "light"
110
+ text = "OCR"
111
+ LeadingIcon = { MdOutlineDocumentScanner }
112
+ onClick = { ( ) => {
113
+ setDisableVideoFocusTrap ( true ) ;
114
+ } }
115
+ />
116
+ </ PopoverButton >
117
+ < PopoverPanel
118
+ anchor = "bottom start"
119
+ transition
120
+ className = { cx (
121
+ "z-10 flex w-[420px] origin-top flex-col overflow-visible!" ,
122
+ "flex origin-top flex-col transition duration-300 ease-out data-closed:translate-y-8 data-closed:opacity-0" ,
123
+ ) }
124
+ >
125
+ { ( { open } ) => {
126
+ checkIfStateChanged ( open ) ;
127
+ return (
128
+ < div className = "mx-auto w-full max-w-xl" >
129
+ < OCRModal videoElmRef = { videoElmRef } />
130
+ </ div >
131
+ ) ;
132
+ } }
133
+ </ PopoverPanel >
134
+ </ Popover >
102
135
< div className = "relative" >
103
136
< Popover >
104
137
< PopoverButton as = { Fragment } >
0 commit comments