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