// App.js
import { useState } from 'react';
import Rating from './components/Rating';
import Thankyou from './components/Thankyou';
function App() {
const [selectedRating, setSelectedRating] = useState(0);
const [showThankyou, setShowThankyou] = useState(false);
const handleRatingChange = (rating) => {
setSelectedRating(rating);
};
const handleRatingSubmit = () => {
setShowThankyou(true);
};
return (
<div className='font-outfit h-screen grid place-items-center'>
{!showThankyou ? (
<Rating onRatingChange={handleRatingChange} onRatingSubmit={handleRatingSubmit} />
) : (
<Thankyou value={selectedRating} />
)}
</div>
);
}
export default App;
// App.js
import { useState } from 'react';
import Rating from './components/Rating';
import Thankyou from './components/Thankyou';
function App() {
const [selectedRating, setSelectedRating] = useState(0);
const [showThankyou, setShowThankyou] = useState(false);
const handleRatingChange = (rating) => {
setSelectedRating(rating);
};
const handleRatingSubmit = () => {
setShowThankyou(true);
};
return (
<div className='font-outfit h-screen grid place-items-center'>
{!showThankyou ? (
<Rating onRatingChange={handleRatingChange} onRatingSubmit={handleRatingSubmit} />
) : (
<Thankyou value={selectedRating} />
)}
</div>
);
}
export default App;