update profile page
This commit is contained in:
@@ -1,19 +1,23 @@
|
||||
import { Suspense } from 'react';
|
||||
import { ChartLoading } from '@/components/report/chart/ChartLoading';
|
||||
import { Widget, WidgetHead } from '@/components/widget';
|
||||
import { cn } from '@/utils/cn';
|
||||
|
||||
type Props = Record<string, unknown> & {
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const withLoadingWidget = <P extends Props>(
|
||||
Component: React.ComponentType<P>
|
||||
) => {
|
||||
const withLoadingWidget = <P,>(Component: React.ComponentType<P>) => {
|
||||
const WithLoadingWidget: React.ComponentType<P> = (props) => {
|
||||
return (
|
||||
<Suspense
|
||||
fallback={
|
||||
<Widget className={props.className}>
|
||||
<Widget
|
||||
className={cn(
|
||||
'w-full',
|
||||
props &&
|
||||
typeof props === 'object' &&
|
||||
'className' in props &&
|
||||
typeof props.className === 'string' &&
|
||||
props?.className
|
||||
)}
|
||||
>
|
||||
<WidgetHead>
|
||||
<span className="title">Loading...</span>
|
||||
</WidgetHead>
|
||||
|
||||
@@ -5,7 +5,7 @@ const withSuspense = <P,>(
|
||||
Fallback: React.ComponentType<P>
|
||||
) => {
|
||||
const WithSuspense: React.ComponentType<P> = (props) => {
|
||||
const fallback = <Fallback {...(props as any)} key="faaaaalling" />;
|
||||
const fallback = <Fallback {...(props as any)} />;
|
||||
return (
|
||||
<Suspense fallback={fallback}>
|
||||
<Component {...(props as any)} />
|
||||
|
||||
Reference in New Issue
Block a user