import { Mulberry32 } from "../utils.js"; import React, { useState, useEffect } from "react"; import AudioVisualizer from "./audioVisualizer.js"; export function Dashboard({ isRecording, onRecord, transcriptionText, finalSummary, topics, stream, }) { const [openIndex, setOpenIndex] = useState(null); const [liveTranscript, setLiveTranscript] = useState(""); topics = topics.map((topic, i) => { topic["decibel"] = generateDecibelData(i + 1 + 333); // for looks only return topic; }); const generateDecibelData = (x) => { let data = []; let random = Mulberry32(123456789 + x); for (let i = 0; i < 50; i++) { data.push(Math.floor(random() * 30) + 10); // generate random values between 10 and 40 } return data; }; const generateDecibelGraph = (decibelData) => { return decibelData.map((decibel, i) => (
 
)); }; return ( <>

Reflector

Capture The Signal, Not The Noise

Timestamp
Topic
{topics.map((item, index) => (
setOpenIndex(openIndex === index ? null : index)} >
{item.timestamp}
{item.title}{" "} {">"}
{generateDecibelGraph(item.decibel)}
{openIndex === index && (
{item.description}
)}
))}
Live
Transcript
{generateDecibelGraph(generateDecibelData())}
{transcriptionText}
{finalSummary && (

Final Summary

Duration: {finalSummary.duration}

{finalSummary.summary}

)}
); }