PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.3
16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 All 506 releases
jetpack / _inc / shared / components / ai-banner / index.jsx

index.jsx in Jetpack – WP Security, Backup, Speed, & Growth 16.3-a.3, at _inc/shared/components/ai-banner/index.jsx

54 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Dark-green AI banner: the shared shell behind the AI announcement banners
3 * (AI Overview's assistant banner, Content Guidelines' empty-state banner).
4 * Renders the rounded dark background, the two gradient orbs, and a close X,
5 * with the caller's title/description/actions layered above.
6 */
7
8 import { Button } from '@wordpress/components';
9 import { __ } from '@wordpress/i18n';
10 import { closeSmall } from '@wordpress/icons';
11 import clsx from 'clsx';
12
13 import './style.scss';
14
15 /**
16 * Dark AI banner shell.
17 *
18 * @param {object} props - Component props.
19 * @param {string} props.className - Extra class for layout overrides (width, margins).
20 * @param {string} props.title - Banner heading.
21 * @param {string} props.description - Supporting copy under the heading.
22 * @param {object} props.actions - Optional action buttons, rendered in a row under the copy.
23 * @param {Function} props.onDismiss - Called when the close X is clicked.
24 * @param {string} props.dismissLabel - Accessible label for the close X.
25 * @return {object} Component markup.
26 */
27 export default function AiBanner( {
28 className,
29 title,
30 description,
31 actions,
32 onDismiss,
33 dismissLabel,
34 } ) {
35 return (
36 <div className={ clsx( 'jetpack-ai-banner', className ) }>
37 <div className="jetpack-ai-banner__content">
38 <h2 className="jetpack-ai-banner__title">{ title }</h2>
39 <p className="jetpack-ai-banner__description">{ description }</p>
40 { actions && <div className="jetpack-ai-banner__actions">{ actions }</div> }
41 </div>
42 <Button
43 className="jetpack-ai-banner__close"
44 icon={ closeSmall }
45 label={ dismissLabel ?? __( 'Dismiss banner', 'jetpack' ) }
46 size="small"
47 onClick={ onDismiss }
48 />
49 <div className="jetpack-ai-banner__orb jetpack-ai-banner__orb--top" />
50 <div className="jetpack-ai-banner__orb jetpack-ai-banner__orb--bottom" />
51 </div>
52 );
53 }
54