You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.0 KiB

import { useState } from "react";
import { useServiceData } from "../../Hooks/Services";
import AddService from "./AddService";
import ServiceTable from "./ServiceTable";
//@ts-ignore
import addicon from "../../assets/addiconpng.png";
import { role } from "../../App";
import { Typography } from "antd";
const Service = () => {
const { data, isLoading, refetch } = useServiceData();
const [open, setOpen] = useState(false);
const showModal = () => {
setOpen(true);
};
return (
<div>
{open && <AddService refetch={refetch} open={open} setOpen={setOpen} />}
<div className="header d-flex" style={{ marginBottom: "10px" }}>
<Typography className="title">Services</Typography>
{role !== "Checker" && (
<button onClick={showModal} className="btn-add d-flex">
<img src={addicon} style={{ marginRight: 8 }} alt="" />
Add Service
</button>
)}
</div>
<ServiceTable data={data} isLoading={isLoading} refetch={refetch} />
</div>
);
};
export default Service;