chore(component): simplify code (#6056)

This commit is contained in:
Jason
2024-03-11 14:04:16 +08:00
committed by GitHub
parent d81c017224
commit fc9bf9cd8a
2 changed files with 12 additions and 18 deletions
@@ -8,10 +8,7 @@ export const WorkspaceDetailSkeleton = () => {
<> <>
<SettingHeader title={<Skeleton />} subtitle={<Skeleton />} /> <SettingHeader title={<Skeleton />} subtitle={<Skeleton />} />
{Array.from({ length: 3 }) {Array.from({ length: 3 }, (_, index) => (
.fill(0)
.map((_, index) => {
return (
<SettingWrapper title={<Skeleton />} key={index}> <SettingWrapper title={<Skeleton />} key={index}>
<SettingRow <SettingRow
name={<Skeleton />} name={<Skeleton />}
@@ -19,8 +16,7 @@ export const WorkspaceDetailSkeleton = () => {
spreadCol={false} spreadCol={false}
></SettingRow> ></SettingRow>
</SettingWrapper> </SettingWrapper>
); ))}
})}
</> </>
); );
}; };
@@ -26,11 +26,9 @@ export const WorkspaceListItemSkeleton = () => {
export const WorkspaceListSkeleton = () => { export const WorkspaceListSkeleton = () => {
return ( return (
<> <>
{Array.from({ length: 5 }) {Array.from({ length: 5 }, (_, index) => (
.fill(0) <WorkspaceListItemSkeleton key={index} />
.map((_, index) => { ))}
return <WorkspaceListItemSkeleton key={index} />;
})}
</> </>
); );
}; };