2021-11-16 18:53:03 +05:30
|
|
|
import * as React from "react";
|
2022-01-14 14:39:21 +05:30
|
|
|
import renderMarkdown from "../markdownRender";
|
2021-10-19 10:54:06 +05:30
|
|
|
|
|
|
|
|
function HabitItem(props: any) {
|
2022-01-14 14:39:21 +05:30
|
|
|
let habit_text = renderMarkdown(props.habit_text);
|
|
|
|
|
let habit_notes = renderMarkdown(props.habit_notes);
|
2021-10-19 10:54:06 +05:30
|
|
|
return (
|
|
|
|
|
<div className="habit-item" id={props.id}>
|
2022-01-13 12:47:36 -08:00
|
|
|
<div className="habit-button-grp">
|
|
|
|
|
<button className="habit-button" id={"plus" + props.id} onClick={props.onChange}>
|
|
|
|
|
+{props.upCount}
|
|
|
|
|
</button>
|
|
|
|
|
<button className="habit-button" id={"mins" + props.id} onClick={props.onChange}>
|
|
|
|
|
-{props.downCount}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2021-11-20 17:11:13 +08:00
|
|
|
<div>
|
2022-01-14 14:39:21 +05:30
|
|
|
<p className="habit-text"><span dangerouslySetInnerHTML={{__html: habit_text}}></span></p>
|
|
|
|
|
<div className="description" dangerouslySetInnerHTML={{__html: habit_notes}}></div>
|
2021-11-20 17:11:13 +08:00
|
|
|
</div>
|
2021-10-19 10:54:06 +05:30
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default HabitItem
|