# packeta/2.3.2/src/PacketaWidget/View.jsx

Packeta, version 2.3.2. 53 lines.

- Page: https://pluginprobe.com/plugins/packeta/2.3.2/code/src/PacketaWidget/View.jsx
- Raw: https://pluginprobe.com/plugins/packeta/2.3.2/raw/src/PacketaWidget/View.jsx
- Modified: 2025-11-07T08:59:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/packeta/2.3.2/code/src/PacketaWidget/View.jsx#L10-L20`.

```jsx
import { ValidatedTextInput } from '@woocommerce/blocks-components';
import { PacketaWidget } from './PacketaWidget';
import { useView } from "./useView";

export const View = ( { cart } ) => {

	const view = useView( cart );
	if ( null === view ) {
		return null;
	}

	const {
		buttonCallback,
		buttonLabel,
		buttonPlace,
		buttonInfo,
		inputValue,
		inputRequired,
		errorMessage,
		showLogo,
		logo,
		translations,
		loading,
	} = view;

	// translations are sometimes unexpectedly undefined
	if ( ! translations ) {
		return null;
	}

	return (
		<PacketaWidget
			onClick={ buttonCallback }
			buttonLabel={ buttonLabel }
			showLogo={ showLogo }
			logoSrc={ logo }
			logoAlt={ translations.packeta }
			place={ buttonPlace }
			info={ buttonInfo }
			loading={ loading }
			placeholderText={ translations.placeholderText }
		>
			<ValidatedTextInput
				key={ inputRequired ? 'required' : 'optional' }
				value={ inputValue }
				required={ inputRequired }
				errorMessage={ errorMessage }
			/>
		</PacketaWidget>
	);

};

```
