I have the following react component
const style = {
"border":"2px solid grey",
"margin-bottom":"2px",
"list-style":"none",
"text-align":"center"
}
const isDoneStyle = {
"text-decoration":"line-through"
}
export default function Todo({name,isComplete,date}) {
return (
<li style={}>
<p>Task: {name}</p>
<input type="checkbox" defaultChecked={isComplete}/>
<p>{date}</p>
</li>
);
}
All the li's should have the style class, but only when isComplete is true it should have the isDoneStyle added. How can I achieve this?