({ card, isFlipped, onFlip }: PracticeCardProps)
| 9 | } |
| 10 | |
| 11 | function PracticeCard({ card, isFlipped, onFlip }: PracticeCardProps) { |
| 12 | const commonCardStyles = { |
| 13 | padding: '1rem', |
| 14 | position: 'absolute' as const, |
| 15 | width: '100%', |
| 16 | height: '100%', |
| 17 | backfaceVisibility: 'hidden' as const, |
| 18 | borderRadius: 'lg', |
| 19 | borderWidth: '1px', |
| 20 | borderColor: 'bg.200', |
| 21 | cursor: 'pointer', |
| 22 | } |
| 23 | |
| 24 | return ( |
| 25 | <Box |
| 26 | onClick={onFlip} |
| 27 | position="relative" |
| 28 | height="100%" |
| 29 | width="100%" |
| 30 | style={{ perspective: '1000px' }} |
| 31 | transition="transform 0.3s ease" |
| 32 | transformStyle="preserve-3d" |
| 33 | transform={isFlipped ? 'rotateY(180deg)' : 'rotateY(0)'} |
| 34 | > |
| 35 | <Box {...commonCardStyles} bg="bg.50"> |
| 36 | <RichTextContent content={card.front} isVisible={!isFlipped} /> |
| 37 | </Box> |
| 38 | |
| 39 | <Box {...commonCardStyles} bg="bg.100" transform="rotateY(180deg)"> |
| 40 | <RichTextContent content={card.back} isVisible={isFlipped} /> |
| 41 | </Box> |
| 42 | </Box> |
| 43 | ) |
| 44 | } |
| 45 | |
| 46 | export default PracticeCard |
no outgoing calls
no test coverage detected