UNPKG

mediasfu-reactnative-expo

Version:

mediasfu-reactnative-expo – Expo-managed React Native WebRTC SDK for video conferencing, webinars, live streaming, broadcast, screen sharing, whiteboard, chat, recording, live subtitles, translation, and AI agent rooms on iOS, Android, and web. Prebuilt r

91 lines (90 loc) 2.6 kB
import React from 'react'; import { EventType } from '../../@types/types'; /** * Interface defining the structure of each share button. */ export interface ShareButton { /** * The name of the FontAwesome5 icon to be displayed. */ icon: string; /** * The function to be called when the share button is pressed. */ action: () => void; /** * Determines if the share button should be displayed. */ show: boolean; /** * The background color of the share button. * @default 'black' */ color?: string; /** * The color of the icon within the share button. * @default '#ffffff' */ iconColor?: string; } /** * Interface defining the props for the ShareButtonsComponent. */ export interface ShareButtonsComponentOptions { /** * The unique identifier for the meeting. */ meetingID: string; /** * An optional array of custom share buttons to display. If not provided, default share buttons will be used. */ shareButtons?: ShareButton[]; /** * The type of event, which can be "chat", "broadcast", or "meeting". This determines the URL structure for sharing. */ eventType: EventType; /** * The link to the Commnity Edition server. */ localLink?: string; } export type ShareButtonsComponentType = (options: ShareButtonsComponentOptions) => JSX.Element; /** * ShareButtonsComponent is a React Native functional component that renders a set of share buttons. * These buttons allow users to share a meeting link via various platforms such as clipboard, email, Facebook, WhatsApp, and Telegram. * * @component * @param {ShareButtonsComponentOptions} props - The properties for the component. * @returns {JSX.Element} The rendered ShareButtonsComponent. * @example * ```tsx * import React from 'react'; * import { ShareButtonsComponent } from 'mediasfu-reactnative-expo'; * * function App() { * return ( * <ShareButtonsComponent * meetingID="123456" * eventType="meeting" * localLink="https://example.com" * shareButtons={[ * { * icon: 'copy', * action: () => console.log('Copied to clipboard'), * show: true, * }, * { * icon: 'envelope', * action: () => console.log('Shared via email'), * show: true, * }, * ]} * /> * ); * } * * export default App; * ``` */ declare const ShareButtonsComponent: React.FC<ShareButtonsComponentOptions>; export default ShareButtonsComponent;