import type { MenuAction } from "@react-native-menu/menu"; import { Pressable } from "react-native"; import { SymbolView } from "./AppSymbol"; import { ControlPillMenu } from "./ControlPill"; const ATTACHMENT_MENU_ACTIONS: MenuAction[] = [ { id: "photos", title: "Photo Library", image: "photo" }, { id: "files", title: "Choose Files", image: "folder" }, ]; export function ComposerAttachmentButton(props: { readonly disabled?: boolean; readonly supportsFiles: boolean; readonly onPickMedia: () => Promise; readonly onPickFiles: () => Promise; }) { const button = ( void props.onPickMedia()} > ); if (props.disabled || !props.supportsFiles) { return button; } return ( { if (nativeEvent.event === "photos") { void props.onPickMedia(); } else if (nativeEvent.event === "files") { void props.onPickFiles(); } }} > {button} ); }