From 8f32fd58cafe677c07d9ed9fff84f6e255156d37 Mon Sep 17 00:00:00 2001 From: darkuss Date: Sat, 22 Aug 2026 01:58:37 +0200 Subject: holy shit i'm finally done --- src/apps/audio.tsx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/apps/audio.tsx (limited to 'src/apps/audio.tsx') diff --git a/src/apps/audio.tsx b/src/apps/audio.tsx new file mode 100644 index 0000000..45d8716 --- /dev/null +++ b/src/apps/audio.tsx @@ -0,0 +1,27 @@ +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, + } +} -- cgit v1.2.3