import { Signal, useSignalEffect } from "@preact/signals" import { Address } from "$/apps/source"; import { memo, Ref, useEffect } from "preact/compat"; const filenameRegex = /.*\/(.*)$/; export const Audio = memo(function Audio({ source, title, contentReady }: Image.Props) { useEffect(() => { contentReady.value = true }, []) useSignalEffect(() => { const filename = decodeURIComponent(source.value.link.pathname.match(filenameRegex)?.[1] ?? source.value.link.toString()); title.value = `${filename} - tunez player`; }) return }) namespace Image { export type Props = { source: Signal
, title: Signal, contentReady: Signal, } }