/** * WordPress dependencies */ import { __, sprintf } from '@wordpress/i18n'; import { ToggleControl } from '@wordpress/components'; /** * SolidWP dependencies */ import { Button, Text } from '@ithemes/ui'; /** * Internal dependencies */ import { BrevoIcon, SendGridIcon, AwsIcon, MailIcon, MailGunIcon, PostmarkIcon, } from '../../../components/icons'; import { ConnectionsTableRow } from '../connections-list/styles'; import { ConnectionActions, ConnectionInfo, ConnectionInfoImage, ConnectionInfoName, ConnectionToggle, } from './styles'; /** * Component to display a connection item with actions to set it as active, edit, or delete. * * @param {Object} props - Component properties. * @param {Object} props.connection - The connection data. * @param {Function} props.onSetConnectionActive - Function to call when setting the connection as active. * @param {Function} props.onDeleteButtonClick - Function to call when deleting the connection. * @param {Function} props.onEditButtonClick - Function to call when editing the connection. * @return {JSX.Element} The ConnectionItem component. */ function ConnectionItem( { connection, onSetConnectionActive, onDeleteButtonClick, onEditButtonClick, } ) { return ( { connection.name === 'brevo' && } { connection.name === 'sendgrid' && } { connection.name === 'mailgun' && } { connection.name === 'amazon_ses' && } { connection.name === 'postmark' && } { connection.name === 'other' && } { connection.display_name } -{ ' ' } { sprintf( /* translators: 1. From Name */ __( 'From: %s', 'LION' ), connection.from_name ) } -{ ' ' } { sprintf( /* translators: 1. Email address */ __( 'From Email: %s', 'LION' ), connection.from_email ) } { onSetConnectionActive( connection.id, value ); } } checked={ connection.is_active } /> ); } export default ConnectionItem;