import type { ReactElement } from "react"; import { Platform, type PressableProps } from "react-native"; import { ControlPillMenu } from "./ControlPill"; import { PresentationSource } from "./NativePresentation"; export function VideoAttachmentMenu(props: { readonly sourceIdentifier: string; readonly onOpen: () => void; readonly onShare?: () => void; readonly disabled?: boolean; readonly children: ReactElement; }) { return ( { if (!props.disabled) props.onOpen(); }} accessibilityActions={props.onShare ? [{ name: "share", label: "Save or share video" }] : []} onAccessibilityAction={({ nativeEvent }) => { if (nativeEvent.actionName === "share" && !props.disabled) props.onShare?.(); }} > {Platform.OS === "ios" && props.onShare ? ( { if (nativeEvent.event === "share") props.onShare?.(); }} > {props.children} ) : ( props.children )} ); }