[0d34a1]: / client / src / components / TestCaseBtn.jsx

Download this file

17 lines (15 with data), 560 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
import { useContext } from "react";
import SelectedContext from "../Contexts";
function TestCaseBtn(props) {
const {selected, setSelected} = useContext(SelectedContext);
return (
<button className={`ml-4 bg-white hover:bg-slate-300 text-indigo-900 px-2 py-1 rounded-lg relative transition transform duration-100 ease-in
${selected===props.number && "translate-x-4"}`}
onClick={()=> {
setSelected(props.number)
}}>
Test Case {props.number}
</button>
);
}
export default TestCaseBtn;