Skip to content

Commit e661d27

Browse files
committed
refactor: run pnpm format
1 parent f64bb09 commit e661d27

File tree

9 files changed

+37
-50
lines changed

9 files changed

+37
-50
lines changed

app/(app)/embed/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@ export default async function Embed() {
99
// FIXME: what is this appConfig thing used for? Do I need it for the embed?
1010
const appConfig = await getAppConfig(origin);
1111

12-
return (
13-
<EmbedAgentClient appConfig={appConfig} />
14-
);
12+
return <EmbedAgentClient appConfig={appConfig} />;
1513
}

app/(app)/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import WelcomeDynamic from "@/components/welcome-dynamic";
1+
import WelcomeDynamic from '@/components/welcome-dynamic';
22

33
export default function Page() {
44
return (
5-
<div className="fixed inset-0 bg-background overflow-auto">
5+
<div className="bg-background fixed inset-0 overflow-auto">
66
<WelcomeDynamic />
77
</div>
88
);

app/components/root.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
"use client";
2-
import dynamic from "next/dynamic";
1+
'use client';
32

4-
export default dynamic(() => import("../components/welcome"), { ssr: false });
3+
import dynamic from 'next/dynamic';
4+
5+
export default dynamic(() => import('../components/welcome'), { ssr: false });

app/globals.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
@apply border-border outline-ring/50;
205205
}
206206
body {
207-
@apply bg-[transparent] text-foreground;
207+
@apply text-foreground bg-[transparent];
208208
}
209209
}
210210

components/embed/agent-client.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { Room, RoomEvent } from 'livekit-client';
55
import { motion } from 'motion/react';
66
import { RoomAudioRenderer, RoomContext, StartAudio } from '@livekit/components-react';
77
import { toastAlert } from '@/components/alert-toast';
8-
import { Toaster } from '@/components/ui/sonner';
9-
import { WelcomeView } from '@/components/embed/welcome-view';
108
import { SessionView } from '@/components/embed/session-view';
9+
import { WelcomeView } from '@/components/embed/welcome-view';
10+
import { Toaster } from '@/components/ui/sonner';
1111
import useConnectionDetails from '@/hooks/useConnectionDetails';
1212
import type { AppConfig } from '@/lib/types';
1313

@@ -75,7 +75,7 @@ function EmbedAgentClient({ appConfig }: AppProps) {
7575
}, [room, sessionStarted, connectionDetails, appConfig.isPreConnectBufferEnabled]);
7676

7777
return (
78-
<div className="relative h-16 bg-background rounded-[31px] border px-3 h-16 drop-shadow-md/3">
78+
<div className="bg-background relative h-16 rounded-[31px] border px-3 drop-shadow-md/3">
7979
<MotionWelcomeView
8080
key="welcome"
8181
onStartCall={() => setSessionStarted(true)}

components/embed/session-view.tsx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
'use client';
22

33
import React, { useEffect } from 'react';
4-
import { motion } from 'motion/react';
54
import { Track } from 'livekit-client';
5+
import { motion } from 'motion/react';
66
import {
77
type AgentState,
8+
BarVisualizer,
89
useRoomContext,
910
useVoiceAssistant,
10-
BarVisualizer,
1111
} from '@livekit/components-react';
1212
import { PhoneDisconnectIcon } from '@phosphor-icons/react/dist/ssr';
13-
1413
import { toastAlert } from '@/components/alert-toast';
15-
import { Button } from '@/components/ui/button';
1614
import { DeviceSelect } from '@/components/livekit/device-select';
1715
import { TrackToggle } from '@/components/livekit/track-toggle';
16+
import { Button } from '@/components/ui/button';
1817
import { useDebugMode } from '@/hooks/useDebug';
1918
import type { AppConfig } from '@/lib/types';
2019
import { cn } from '@/lib/utils';
21-
2220
import { useAgentControlBar } from './hooks/use-agent-control-bar';
2321

2422
function isAgentAvailable(agentState: AgentState) {
@@ -48,7 +46,7 @@ export const SessionView = ({
4846
handleDisconnect,
4947
} = useAgentControlBar({
5048
controls: { microphone: true },
51-
saveUserChoices: true
49+
saveUserChoices: true,
5250
});
5351

5452
const onLeave = () => {
@@ -105,11 +103,8 @@ export const SessionView = ({
105103
}}
106104
transition={{ duration: 0.3, delay: sessionStarted ? 0.5 : 0, ease: 'easeOut' }}
107105
>
108-
<div
109-
aria-label="Voice assistant controls"
110-
className="absolute inset-0"
111-
>
112-
<div className="flex flex-row items-center justify-between h-full gap-1 px-3">
106+
<div aria-label="Voice assistant controls" className="absolute inset-0">
107+
<div className="flex h-full flex-row items-center justify-between gap-1 px-3">
113108
<div className="flex gap-1">
114109
{visibleControls.microphone ? (
115110
<div className="flex items-center gap-0">
@@ -159,7 +154,7 @@ export const SessionView = ({
159154
</div>
160155

161156
{appConfig.isPreConnectBufferEnabled ? (
162-
<div className="absolute left-1/2 -translate-x-1/2 h-full flex justify-center items-center gap-2">
157+
<div className="absolute left-1/2 flex h-full -translate-x-1/2 items-center justify-center gap-2">
163158
<BarVisualizer
164159
barCount={3}
165160
trackRef={agentAudioTrack}
@@ -184,8 +179,8 @@ export const SessionView = ({
184179
{visibleControls.leave ? (
185180
<Button variant="destructive" onClick={onLeave} className="font-mono">
186181
<PhoneDisconnectIcon weight="bold" />
187-
<span className="hidden md:inline uppercase">End Call</span>
188-
<span className="inline md:hidden uppercase">End</span>
182+
<span className="hidden uppercase md:inline">End Call</span>
183+
<span className="inline uppercase md:hidden">End</span>
189184
</Button>
190185
) : null}
191186
</div>

components/embed/welcome-view.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@ export const WelcomeView = ({
1111
ref,
1212
}: React.ComponentProps<'div'> & WelcomeViewProps) => {
1313
return (
14-
<div
15-
ref={ref}
16-
inert={disabled}
17-
className="absolute inset-0"
18-
>
19-
<div className="flex gap-4 items-center justify-between h-full gap-1 px-3">
14+
<div ref={ref} inert={disabled} className="absolute inset-0">
15+
<div className="flex h-full items-center justify-between gap-1 gap-4 px-3">
2016
<div className="pl-3">
2117
<img src="/lk-logo.svg" alt="LiveKit Logo" className="block size-6 dark:hidden" />
2218
<img src="/lk-logo-dark.svg" alt="LiveKit Logo" className="hidden size-6 dark:block" />

components/welcome-dynamic.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
"use client";
2-
import dynamic from "next/dynamic";
1+
'use client';
32

4-
export default dynamic(() => import("./welcome"), { ssr: false });
3+
import dynamic from 'next/dynamic';
4+
5+
export default dynamic(() => import('./welcome'), { ssr: false });

components/welcome.tsx

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
"use client";
1+
'use client';
22

3-
import { useMemo } from "react";
3+
import { useMemo } from 'react';
44

55
export default function Welcome() {
66
const embedUrl = useMemo(() => {
@@ -10,23 +10,19 @@ export default function Welcome() {
1010

1111
return (
1212
<div className="flex flex-col items-center pt-16">
13-
<div className="flex flex-col gap-4 max-w-xl p-4 border rounded-md bg-bg3">
14-
<h1 className="font-bold text-2xl">LiveKit Embed Starter</h1>
13+
<div className="bg-bg3 flex max-w-xl flex-col gap-4 rounded-md border p-4">
14+
<h1 className="text-2xl font-bold">LiveKit Embed Starter</h1>
1515
<p>
16-
The embed starter example contains an example implementation of an embeddable LiveKit control
17-
that can be added to a web app to talk to your agent, no custom javascript code required.
16+
The embed starter example contains an example implementation of an embeddable LiveKit
17+
control that can be added to a web app to talk to your agent, no custom javascript code
18+
required.
1819
</p>
1920

20-
<h2 className="font-bold text-lg">Example</h2>
21-
<iframe
22-
src={embedUrl}
23-
style={{ width: 320, height: 64 }}
24-
/>
21+
<h2 className="text-lg font-bold">Example</h2>
22+
<iframe src={embedUrl} style={{ width: 320, height: 64 }} />
2523

26-
<h2 className="font-bold text-lg">Usage</h2>
27-
<p>
28-
To include the embed into a web app, paste the below embed HTML into the page:
29-
</p>
24+
<h2 className="text-lg font-bold">Usage</h2>
25+
<p>To include the embed into a web app, paste the below embed HTML into the page:</p>
3026
<pre>
3127
{`<iframe\n src="${embedUrl}"\n style="width: 320px; height: 64px;"\n></iframe>`}
3228
</pre>

0 commit comments

Comments
 (0)