blob: 71b2f4e090854747d8ca4afdbf52536f18d924cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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>
}
}
|