Remove formatting

This commit is contained in:
James Hush
2025-04-14 15:13:45 +08:00
parent dae3b927e1
commit b160cf34e9

View File

@@ -1,13 +1,13 @@
import { useRef, useCallback } from "react"; import { useRef, useCallback } from 'react';
import { import {
Participant, Participant,
RTVIEvent, RTVIEvent,
TransportState, TransportState,
TranscriptData, TranscriptData,
BotLLMTextData, BotLLMTextData,
} from "@pipecat-ai/client-js"; } from '@pipecat-ai/client-js';
import { useRTVIClient, useRTVIClientEvent } from "@pipecat-ai/client-react"; import { useRTVIClient, useRTVIClientEvent } from '@pipecat-ai/client-react';
import "./DebugDisplay.css"; import './DebugDisplay.css';
export function DebugDisplay() { export function DebugDisplay() {
const debugLogRef = useRef<HTMLDivElement>(null); const debugLogRef = useRef<HTMLDivElement>(null);
@@ -16,14 +16,14 @@ export function DebugDisplay() {
const log = useCallback((message: string) => { const log = useCallback((message: string) => {
if (!debugLogRef.current) return; if (!debugLogRef.current) return;
const entry = document.createElement("div"); const entry = document.createElement('div');
entry.textContent = `${new Date().toISOString()} - ${message}`; entry.textContent = `${new Date().toISOString()} - ${message}`;
// Add styling based on message type // Add styling based on message type
if (message.startsWith("User: ")) { if (message.startsWith('User: ')) {
entry.style.color = "#2196F3"; // blue for user entry.style.color = '#2196F3'; // blue for user
} else if (message.startsWith("Bot: ")) { } else if (message.startsWith('Bot: ')) {
entry.style.color = "#4CAF50"; // green for bot entry.style.color = '#4CAF50'; // green for bot
} }
debugLogRef.current.appendChild(entry); debugLogRef.current.appendChild(entry);
@@ -68,7 +68,7 @@ export function DebugDisplay() {
useCallback( useCallback(
(track: MediaStreamTrack, participant?: Participant) => { (track: MediaStreamTrack, participant?: Participant) => {
log( log(
`Track started: ${track.kind} from ${participant?.name || "unknown"}` `Track started: ${track.kind} from ${participant?.name || 'unknown'}`
); );
}, },
[log] [log]
@@ -80,7 +80,7 @@ export function DebugDisplay() {
useCallback( useCallback(
(track: MediaStreamTrack, participant?: Participant) => { (track: MediaStreamTrack, participant?: Participant) => {
log( log(
`Track stopped: ${track.kind} from ${participant?.name || "unknown"}` `Track stopped: ${track.kind} from ${participant?.name || 'unknown'}`
); );
}, },
[log] [log]