PluginProbe
Code Snippets / trunk
Code Snippets vtrunk
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
code-snippets / js / components / ManageMenu / AiAgentDemo / DemoThread.tsx

DemoThread.tsx in Code Snippets trunk, at js/components/ManageMenu/AiAgentDemo/DemoThread.tsx

36 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React from 'react'
2 import { __ } from '@wordpress/i18n'
3
4 interface DemoMessageProps {
5 speaker: 'user' | 'assistant'
6 children: React.ReactNode
7 }
8
9 export const DemoMessage: React.FC<DemoMessageProps> = ({ speaker, children }) =>
10 <div className={`ai-agent-message is-${speaker}`}>
11 <span className="ai-agent-message__role">
12 {'user' === speaker ? __('You', 'code-snippets') : __('AI Agent', 'code-snippets')}
13 </span>
14 <div className="ai-agent-message__content">{children}</div>
15 </div>
16
17 export const DemoTyping: React.FC<{ label: string }> = ({ label }) =>
18 <div className="ai-agent-typing">
19 <span className="ai-agent-typing__dots" aria-hidden="true"><i /><i /><i /></span>
20 <span>{label}</span>
21 </div>
22
23 /**
24 * Stand-in for the round trip the real agent makes to Code Snippets Cloud. It
25 * carries no state of its own — the parent decides when the trip is in flight.
26 */
27 export const DemoTransit: React.FC<{ label: string }> = ({ label }) =>
28 <div className="ai-agent-demo-transit">
29 <span className="ai-agent-demo-transit__endpoint">{__('Your site', 'code-snippets')}</span>
30 <span className="ai-agent-demo-transit__track" aria-hidden="true">
31 <span className="ai-agent-demo-transit__pulse" />
32 </span>
33 <span className="ai-agent-demo-transit__endpoint">{__('Code Snippets Cloud', 'code-snippets')}</span>
34 <span className="screen-reader-text">{label}</span>
35 </div>
36