videogen/apps/watch/app/index.tsx
caelum0x d56639a594
Some checks are pending
build-images / api (push) Waiting to run
build-images / worker-gpu (push) Waiting to run
build-images / web (push) Waiting to run
codeql / Analyze (javascript-typescript) (push) Waiting to run
codeql / Analyze (python) (push) Waiting to run
perf / API hot-path micro-smoke (budgeted) (push) Waiting to run
perf / Desktop engine crates (release build check) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Waiting to run
vision2026-ci / API phase modules (ruff + pytest) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Waiting to run
vision2026-ci / Python SDK resource tests (push) Waiting to run
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Waiting to run
vision2026-ci / Alembic upgrade + drift check (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Waiting to run
Menivor — open source release (MIT), free to use and fork
Paid, hosted product at menivor.com, now retired as a company project.
Fresh squashed history of the cleaned working tree (secret-scanned,
no .env, no customer data, no outreach logs). Built on
MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
2026-12-04 02:10:26 +03:00

68 lines
2.7 KiB
TypeScript

import * as React from "react";
import { Pressable, StyleSheet, Text, TextInput, View } from "react-native";
import { router } from "expo-router";
import { useWatch } from "../src/context";
import { parseChannel, recentChannels, rememberChannel } from "../src/session/store";
import { theme } from "../src/ui/theme";
/** Pick a channel: type its name or a channel link, or open one you watched before. */
export default function Channels() {
const { kv } = useWatch();
const [input, setInput] = React.useState("");
const [recent, setRecent] = React.useState<string[]>([]);
const [error, setError] = React.useState("");
React.useEffect(() => {
void recentChannels(kv).then(setRecent);
}, [kv]);
const open = async (raw: string) => {
const handle = parseChannel(raw);
if (!handle) {
setError("Type a channel name, like maya-films, or paste its link.");
return;
}
setRecent(await rememberChannel(kv, handle));
router.push(`/c/${handle}`);
};
return (
<View style={styles.page}>
<Text style={styles.h1}>Menivor TV</Text>
<TextInput
style={styles.input}
value={input}
onChangeText={setInput}
onSubmitEditing={() => void open(input)}
placeholder="Channel name or link"
placeholderTextColor={theme.muted}
autoCapitalize="none"
autoCorrect={false}
hasTVPreferredFocus
accessibilityLabel="Channel name or link"
/>
<Pressable style={styles.button} onPress={() => void open(input)} accessibilityRole="button">
<Text style={styles.buttonText}>Open channel</Text>
</Pressable>
{error ? <Text accessibilityRole="alert" style={styles.error}>{error}</Text> : null}
{recent.length ? <Text style={styles.h2}>Watched before</Text> : null}
{recent.map((handle) => (
<Pressable key={handle} style={styles.recent} onPress={() => void open(handle)} accessibilityRole="button">
<Text style={styles.buttonText}>{handle}</Text>
</Pressable>
))}
</View>
);
}
const styles = StyleSheet.create({
page: { flex: 1, padding: 48, gap: 16, backgroundColor: theme.background },
h1: { color: theme.text, fontSize: 36, fontWeight: "700" },
h2: { color: theme.muted, fontSize: 20, marginTop: 24 },
input: { color: theme.text, fontSize: 22, borderWidth: 1, borderColor: theme.muted, borderRadius: theme.radius, padding: 16 },
button: { backgroundColor: theme.surface, borderRadius: theme.radius, padding: 16, alignSelf: "flex-start" },
recent: { backgroundColor: theme.surface, borderRadius: theme.radius, padding: 14, alignSelf: "flex-start" },
buttonText: { color: theme.text, fontSize: 20 },
error: { color: theme.text, fontSize: 18 },
});