/ src / components / ScoreDisplay.tsx
ScoreDisplay.tsx
 1  import React from 'react';
 2  import { Button } from './Button';
 3  
 4  interface ScoreDisplayProps {
 5    score: number;
 6    onAgain: () => void;
 7    onGood: () => void;
 8  }
 9  
10  const ScoreDisplay: React.FC<ScoreDisplayProps> = ({ score, onAgain, onGood }) => {
11    return (
12      <div className="text-center">
13        <p className="text-2xl font-bold mb-4">Score: {score}%</p>
14        <div className="flex justify-between space-x-4">
15          <Button
16            label="Again"
17            onClick={onAgain}
18            variant="secondary"
19            fullWidth
20          />
21          <Button
22            label="Good"
23            onClick={onGood}
24            variant="primary"
25            fullWidth
26          />
27        </div>
28      </div>
29    );
30  };
31  
32  export default ScoreDisplay;