fix(web): my sharing app add empty

This commit is contained in:
zhaoying
2026-03-18 12:05:59 +08:00
parent 83894df260
commit 859b7f3c7f

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 16:34:12
* @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 { useTranslation } from 'react-i18next';
@@ -11,6 +11,7 @@ import clsx from 'clsx';
import type { MySharedOutItem } from './types';
import { mySharedOutList, cancelShare, cancelSpaceShare } from '@/api/application'
import BodyWrapper from '@/components/Empty/BodyWrapper'
const MySharing: React.FC = () => {
const { t } = useTranslation();
@@ -20,7 +21,8 @@ const MySharing: React.FC = () => {
useEffect(() => { getList() }, [])
const getList = () => {
mySharedOutList().then(res => setData(res as MySharedOutItem[]))
mySharedOutList()
.then(res => setData(res as MySharedOutItem[]))
}
/** Group items by target_workspace_id */
@@ -73,7 +75,8 @@ const MySharing: React.FC = () => {
};
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 }) => (
<Collapse
key={workspace.target_workspace_id}
@@ -151,6 +154,7 @@ const MySharing: React.FC = () => {
}]}
/>
))}
</BodyWrapper>
</Flex>
);
};