added spin to expand icon

master
alex 2024-01-25 22:38:29 +01:00
parent ffe42d2a74
commit 238e19af2a
1 changed files with 13 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import { InfoCircleOutlined, PlusOutlined } from "@ant-design/icons"; import { CaretRightOutlined, PlusOutlined } from "@ant-design/icons";
import { import {
Avatar, Avatar,
Button, Button,
@ -192,6 +192,17 @@ function Service({
useEffect(() => fetchServiceActivities(), [isOpen]); useEffect(() => fetchServiceActivities(), [isOpen]);
const expandIcon = ({ isActive }) => {
if (isRequestingActivities) return <Spin size="small" />;
return (
<CaretRightOutlined
rotate={isActive ? 90 : 0}
onClick={(e) => e.stopPropagation()}
/>
);
};
return ( return (
<> <>
{notificationContextHolder} {notificationContextHolder}
@ -199,6 +210,7 @@ function Service({
<Collapse <Collapse
key={service.service_id} key={service.service_id}
onChange={(e) => setIsOpen(e.length !== 0)} onChange={(e) => setIsOpen(e.length !== 0)}
expandIcon={expandIcon}
items={[ items={[
{ {
key: "1", key: "1",