import React from 'react'; import { ipcRenderer } from 'electron'; import { Row, Col } from 'react-flexbox-grid'; import SharingSourcePreviewCard from '../../SharingSourcePreviewCard'; import { IpcEvents } from '../../../main/IpcEvents.enum'; class PreviewGridListProps { viewSharingIds: string[] = []; isEntireScreen = true; handleNextEntireScreen = () => {}; handleNextApplicationWindow = () => {}; } export default function PreviewGridList(props: PreviewGridListProps) { const { viewSharingIds, isEntireScreen, handleNextEntireScreen, handleNextApplicationWindow, } = props; return ( {viewSharingIds.map((id) => { return ( { ipcRenderer.invoke(IpcEvents.SetDesktopCapturerSourceId, id); if (isEntireScreen) { handleNextEntireScreen(); } else { handleNextApplicationWindow(); } }} /> ); })} ); }