summaryrefslogtreecommitdiff
path: root/src/apps/browser.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/apps/browser.tsx')
-rw-r--r--src/apps/browser.tsx23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/apps/browser.tsx b/src/apps/browser.tsx
new file mode 100644
index 0000000..71b2f4e
--- /dev/null
+++ b/src/apps/browser.tsx
@@ -0,0 +1,23 @@
+import { Signal, useSignalEffect } from "@preact/signals"
+import { Address } from "$/apps/source";
+import { memo, useEffect } from "preact/compat";
+
+export const Browser = memo(function Browser({ source, title, contentReady }: Browser.Props) {
+ useEffect(() => {
+ contentReady.value = true
+ }, [])
+
+ useSignalEffect(() => {
+ title.value = `${source.value.link} - internet exploder`;
+ })
+
+ return <iframe src={source.value.link.toString()} allowFullScreen={ source.value.link.hostname.includes("youtube.com") } height="40vh" width="40vw"/>
+})
+
+namespace Browser {
+ export type Props = {
+ source: Signal<Address>,
+ title: Signal<string | undefined>,
+ contentReady: Signal<boolean>
+ }
+}