fix(web): my sharing app add empty
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-03 16:34:12
|
* @Date: 2026-02-03 16:34:12
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-03-18 10:44:32
|
* @Last Modified time: 2026-03-18 11:20:45
|
||||||
*/
|
*/
|
||||||
import React, { useState, useEffect, useMemo } from 'react';
|
import React, { useState, useEffect, useMemo } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@@ -11,6 +11,7 @@ import clsx from 'clsx';
|
|||||||
|
|
||||||
import type { MySharedOutItem } from './types';
|
import type { MySharedOutItem } from './types';
|
||||||
import { mySharedOutList, cancelShare, cancelSpaceShare } from '@/api/application'
|
import { mySharedOutList, cancelShare, cancelSpaceShare } from '@/api/application'
|
||||||
|
import BodyWrapper from '@/components/Empty/BodyWrapper'
|
||||||
|
|
||||||
const MySharing: React.FC = () => {
|
const MySharing: React.FC = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -20,7 +21,8 @@ const MySharing: React.FC = () => {
|
|||||||
useEffect(() => { getList() }, [])
|
useEffect(() => { getList() }, [])
|
||||||
|
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
mySharedOutList().then(res => setData(res as MySharedOutItem[]))
|
mySharedOutList()
|
||||||
|
.then(res => setData(res as MySharedOutItem[]))
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Group items by target_workspace_id */
|
/** Group items by target_workspace_id */
|
||||||
@@ -73,7 +75,8 @@ const MySharing: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex vertical gap={12}>
|
<Flex vertical gap={12} className="rb:h-[calc(100vh-148px)]! rb:overflow-y-auto!">
|
||||||
|
<BodyWrapper loading={false} empty={data.length === 0}>
|
||||||
{grouped.map(({ workspace, items }) => (
|
{grouped.map(({ workspace, items }) => (
|
||||||
<Collapse
|
<Collapse
|
||||||
key={workspace.target_workspace_id}
|
key={workspace.target_workspace_id}
|
||||||
@@ -151,6 +154,7 @@ const MySharing: React.FC = () => {
|
|||||||
}]}
|
}]}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
</BodyWrapper>
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user