All files / src/shared/ui/buttons/HistoryExitPreviewButton HistoryExitPreviewButton.tsx

66.66% Statements 2/3
100% Branches 0/0
50% Functions 1/2
66.66% Lines 2/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20          14x 1x                          
import React from 'react';
import { motion } from 'framer-motion';
import { useAppDispatch } from '@/store/hooks';
import { setPreview } from '@/entities/history/model/slice';
 
export const HistoryExitPreviewButton = React.memo(function HistoryExitPreviewButton() {
	const dispatch = useAppDispatch();
 
	return (
		<motion.button
			whileHover={{ scale: 1.04 }}
			whileTap={{ scale: 0.96 }}
			onClick={() => dispatch(setPreview(false))}
			className="flex-1 border border-gray-300 hover:bg-gray-50 text-sm py-1 rounded cursor-pointer"
		>
			Exit
		</motion.button>
	);
});