import { Ionicons } from "@expo/vector-icons"; import { useMemo } from "react"; import { View } from "react-native"; import { useSettings } from "@/utils/atoms/settings"; import type { ChromecastProfileMode } from "@/utils/casting/capabilities"; import { Text } from "../common/Text"; import { ListGroup } from "../list/ListGroup"; import { ListItem } from "../list/ListItem"; import { PlatformDropdown } from "../PlatformDropdown"; const PROFILE_LABELS: Record = { auto: "Automatic (recommended)", "force-hevc": "Force HEVC / H265", "force-h264": "Force H264", }; export const ChromecastSettings: React.FC = ({ ...props }) => { const { settings, updateSettings } = useSettings(); const profileOptions = useMemo( () => [ { options: ( ["auto", "force-hevc", "force-h264"] as ChromecastProfileMode[] ).map((mode) => ({ type: "radio" as const, label: PROFILE_LABELS[mode], value: mode, selected: (settings.chromecastProfile ?? "auto") === mode, onPress: () => updateSettings({ chromecastProfile: mode }), })), }, ], [settings.chromecastProfile, updateSettings], ); return ( {PROFILE_LABELS[settings.chromecastProfile ?? "auto"]} } /> ); };