import axios from 'axios'; import React, { Component } from 'react'; import './App.css'; import Button from 'react-bootstrap/Button'; import Form from 'react-bootstrap/Form'; import Spinner from 'react-bootstrap/Spinner'; import Container from 'react-bootstrap/Container'; import Image from 'react-bootstrap/Image'; class App extends Component { state = { isLoadingVisible: false, val: '', imgSrc: '', style_preset: 'photographic' // Default to photographic }; showLoading = () => { this.setState({ isLoadingVisible: true }); }; hideLoading = () => { this.setState({ isLoadingVisible: false }); }; handleChange = (e) => { this.setState({ style_preset: e.target.value }); }; handleSubmit = (e) => { e.preventDefault(); this.showLoading(); const api = process.env.NODE_ENV === 'development' ? 'test/genai' : ''; // Replace with your API GW Endpoint const data = { data: e.target.searchQuery.value, style_preset: this.state.style_preset }; axios({ method: 'POST', data: JSON.stringify(data), headers: { 'Content-Type': 'application/json' }, url: api, }) .then((response) => { this.setState({ imgSrc: response.data.body }); setTimeout(() => { this.hideLoading(); this.setState({ val: '' }); }, 500); }) .catch((error) => { console.log(error); }); }; render() { return (

Unleashing Machine Learning with Amazon Bedrock

Your Words, Our Canvas: Enter Text to Create Image! We'll sketch, stretch, and kvetch until your image is a fetching fetch {/* Title for Radio buttons */}

Select your style:

{/* Radio buttons horizontally aligned with some styling */}
{this.state.isLoadingVisible && (
)}
); } } export default App;