Create eventTask component
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import styles from "./eventTask.module.css";
|
||||
import { formatDateLetter } from "../../utils/date/formatDateLetter.js";
|
||||
import Button from "../ui/button/button.jsx";
|
||||
import assign from "../../utils/tasks/assign.js";
|
||||
|
||||
export default function EventTask({ task, index }) {
|
||||
|
||||
const handleRegisterBtn = async (eventId) => {
|
||||
console.log(eventId);
|
||||
await assign(eventId);
|
||||
}
|
||||
|
||||
return <div style={{"--i": index}} key={index} className={styles.content}>
|
||||
<div className={styles.task}>
|
||||
<div>
|
||||
<span><strong>{task.name}</strong></span>
|
||||
<p className={styles.taskDate}> {formatDateLetter(task.start)} - {formatDateLetter(task.end)} </p>
|
||||
<p>{task.description}</p>
|
||||
</div>
|
||||
<Button onClick={() => handleRegisterBtn(task.id)}> S’inscrire </Button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
Reference in New Issue
Block a user