FIX - Deploy bug
This commit is contained in:
@@ -1,20 +1,18 @@
|
||||
import React, { } from "react";
|
||||
import { FaTrashAlt} from "react-icons/fa";
|
||||
import useDeletePoll from "../../hooks/usedeletePoll";
|
||||
import React from "react";
|
||||
import { FaTrashAlt } from "react-icons/fa";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import useDeletePoll from "../../hooks/useDeletePoll";
|
||||
|
||||
function PollTableRow({ poll, index, refetch }) {
|
||||
|
||||
const navigator = useNavigate();
|
||||
const handleDelete = useDeletePoll(poll._id, refetch);
|
||||
|
||||
const handleViewOnClick = () => {
|
||||
navigator(`/view/${poll._id}`);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
<tr>
|
||||
<th>{index + 1}</th>
|
||||
<td className="text-white">{poll.title}</td>
|
||||
@@ -30,10 +28,16 @@ function PollTableRow({ poll, index, refetch }) {
|
||||
</td>
|
||||
<td>
|
||||
<div className="flex md:flex-row flex-wrap flex-col gap-2">
|
||||
<button onClick={handleViewOnClick} className="btn btn-sm btn-primary flex items-center">
|
||||
<button
|
||||
onClick={handleViewOnClick}
|
||||
className="btn btn-sm btn-primary flex items-center"
|
||||
>
|
||||
<FaTrashAlt className="mr-1" /> View
|
||||
</button>
|
||||
<button onClick={handleDelete} className="btn btn-sm btn-error flex items-center">
|
||||
<button
|
||||
onClick={handleDelete}
|
||||
className="btn btn-sm btn-error flex items-center"
|
||||
>
|
||||
<FaTrashAlt className="mr-1" /> Delete
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user