import React from "react"; import { View, Switch, StyleSheet } from "react-native"; import { ThemedText } from "@/components/ThemedText"; import { ThemedView } from "@/components/ThemedView"; import { useSettingsStore } from "@/stores/settingsStore"; import { useRemoteControlStore } from "@/stores/remoteControlStore"; interface RemoteInputSectionProps { onChanged: () => void; } export const RemoteInputSection: React.FC = ({ onChanged }) => { const { remoteInputEnabled, setRemoteInputEnabled } = useSettingsStore(); const { isServerRunning, serverUrl, error } = useRemoteControlStore(); const handleToggle = async (enabled: boolean) => { setRemoteInputEnabled(enabled); onChanged(); }; return ( 启用远程输入 {remoteInputEnabled && ( 服务状态: {isServerRunning ? "运行中" : "已停止"} {serverUrl && ( 访问地址: {serverUrl} )} {error && ( 错误: {error} )} )} ); }; const styles = StyleSheet.create({ section: { padding: 20, marginBottom: 16, borderRadius: 12, borderWidth: 1, borderColor: "#333", }, sectionTitle: { fontSize: 20, fontWeight: "bold", marginBottom: 16, }, settingItem: { flexDirection: "row", justifyContent: "space-between", alignItems: "center", paddingVertical: 12, }, settingInfo: { flex: 1, }, settingName: { fontSize: 16, fontWeight: "bold", marginBottom: 4, }, settingDescription: { fontSize: 14, color: "#888", }, statusContainer: { marginTop: 16, padding: 16, backgroundColor: "#2a2a2c", borderRadius: 8, }, statusItem: { flexDirection: "row", marginBottom: 8, }, statusLabel: { fontSize: 14, color: "#ccc", minWidth: 80, }, statusValue: { fontSize: 14, flex: 1, }, actionButtons: { flexDirection: "row", gap: 12, marginTop: 12, }, actionButton: { flex: 1, }, });