31 lines
781 B
JavaScript
31 lines
781 B
JavaScript
import { Button } from "@mui/material";
|
|
import SearchD from "@/components/icons/SearchD";
|
|
import { useState } from "react";
|
|
|
|
function SendReq({ sendReq }) {
|
|
const [loading, setLoading] = useState(false);
|
|
|
|
const filterData = () => {
|
|
setLoading(true);
|
|
|
|
sendReq().finally(() => {
|
|
setLoading(false);
|
|
});
|
|
};
|
|
|
|
return (
|
|
<Button
|
|
loading={loading}
|
|
onClick={filterData}
|
|
className="!flex !m-1 !rounded-[4px] !w-[36px] sm:!w-[42px] md:!w-[49px] lg:!w-[56px] !min-w-[36px] sm:!min-w-[42px] md:!min-w-[49px] lg:!min-w-[56px]
|
|
!gap-2.5 !p-2.5 md:!p-4 !h-[calc(100%_-_8px)]"
|
|
>
|
|
<div className="w-[24px] h-[24px] min-w-[24px] min-h-[24px]">
|
|
{!loading && <SearchD />}
|
|
</div>
|
|
</Button>
|
|
);
|
|
}
|
|
|
|
export default SendReq;
|