Skip to content

Commit

Permalink
Update the no agent connection msg
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocupe committed Sep 26, 2024
1 parent 7461b8b commit c3fc51f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
16 changes: 3 additions & 13 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ export default function Page() {
const onConnectButtonClicked = useCallback(async () => {
const url = new URL(
process.env.NEXT_PUBLIC_CONN_DETAILS_ENDPOINT ??
"/api/connection-details",
"/api/connection-details",
window.location.origin
);
const subdomain = window.location.host.split(".")[0];
const response = await fetch(
url.toString(),
{ headers: { "X-Sandbox-ID": subdomain } });
const response = await fetch(url.toString());
const connectionDetailsData = await response.json();
updateConnectionDetails(connectionDetailsData);
}, []);
Expand Down Expand Up @@ -72,14 +69,7 @@ function SimpleVoiceAssistant() {
<div className="h-80">
<BarVisualizer state={state} barCount={7} trackRef={audioTrack} />
<p className="text-center">{state}</p>
<NoAgentNotification state={state}>
<p>
No agent joined this session. Follow the guide to setup your agent.
</p>
<a href="#" className="underline whitespace-nowrap">
View guide
</a>
</NoAgentNotification>
<NoAgentNotification state={state} />
</div>
);
}
Expand Down
10 changes: 8 additions & 2 deletions components/NoAgentNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function NoAgentNotification(props: NoAgentNotificationProps) {
return (
<>
{showNotification ? (
<div className="fixed text-sm left-1/2 -translate-x-1/2 flex top-6 items-center gap-4 bg-[#131313] font-mono px-4 py-3 rounded">
<div className="fixed text-sm left-1/2 max-w-[90vw] -translate-x-1/2 flex top-6 items-center gap-4 bg-[#1F1F1F] px-4 py-3 rounded-lg">
<div>
{/* Warning Icon */}
<svg
Expand All @@ -51,7 +51,13 @@ export function NoAgentNotification(props: NoAgentNotificationProps) {
/>
</svg>
</div>
{props.children}
<p className="text-pretty w-max">
It&apos;s quiet... too quiet. Is your agent lost? Make sure your
agent is set up and running correctly.
</p>
<a href="#" className="underline whitespace-nowrap">
View guide
</a>
<button onClick={() => setShowNotification(false)}>
{/* Close Icon */}
<svg
Expand Down

0 comments on commit c3fc51f

Please sign in to comment.