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
29 lines • 974 B
JavaScript
export const generateRandomPolls = ({ numberOfPolls }) => {
const pollTypes = ['trueFalse', 'yesNo', 'custom'];
const polls = [];
for (let i = 0; i < numberOfPolls; i++) {
const type = pollTypes[Math.floor(Math.random() * pollTypes.length)];
let options;
switch (type) {
case 'trueFalse':
options = ['True', 'False'];
break;
case 'yesNo':
options = ['Yes', 'No'];
break;
default:
options = Array.from({ length: Math.floor(Math.random() * 5) + 2 }, (_, idx) => `Option ${idx + 1}`);
}
polls.push({
id: `${i + 1}`,
question: `Random Question ${i + 1}`,
type,
options,
votes: Array(options.length).fill(0),
status: 'inactive',
voters: {},
});
}
return polls;
};
//# sourceMappingURL=generateRandomPolls.js.map