mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor: refactor layout components to use SuspenseHelper for loading states
This commit is contained in:
@@ -1,21 +1,11 @@
|
|||||||
'use client';
|
import SuspenseHelper from '@/components/helper/SuspenseHelper';
|
||||||
|
|
||||||
import { Suspense } from 'react';
|
const Layout = ({
|
||||||
|
|
||||||
export default function AreaLayout({
|
|
||||||
children,
|
children,
|
||||||
}: {
|
}: Readonly<{
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}>) => {
|
||||||
return (
|
return <SuspenseHelper>{children}</SuspenseHelper>;
|
||||||
<Suspense
|
};
|
||||||
fallback={
|
|
||||||
<div className='w-full flex flex-row justify-center items-center p-4'>
|
export default Layout;
|
||||||
<span className='loading loading-spinner loading-xl' />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Suspense>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,21 +1,11 @@
|
|||||||
'use client';
|
import SuspenseHelper from '@/components/helper/SuspenseHelper';
|
||||||
|
|
||||||
import { Suspense } from 'react';
|
const Layout = ({
|
||||||
|
|
||||||
export default function KandangLayout({
|
|
||||||
children,
|
children,
|
||||||
}: {
|
}: Readonly<{
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}>) => {
|
||||||
return (
|
return <SuspenseHelper>{children}</SuspenseHelper>;
|
||||||
<Suspense
|
};
|
||||||
fallback={
|
|
||||||
<div className='w-full flex flex-row justify-center items-center p-4'>
|
export default Layout;
|
||||||
<span className='loading loading-spinner loading-xl' />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Suspense>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,21 +1,11 @@
|
|||||||
'use client';
|
import SuspenseHelper from '@/components/helper/SuspenseHelper';
|
||||||
|
|
||||||
import { Suspense } from 'react';
|
const Layout = ({
|
||||||
|
|
||||||
export default function LocationLayout({
|
|
||||||
children,
|
children,
|
||||||
}: {
|
}: Readonly<{
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}>) => {
|
||||||
return (
|
return <SuspenseHelper>{children}</SuspenseHelper>;
|
||||||
<Suspense
|
};
|
||||||
fallback={
|
|
||||||
<div className='w-full flex flex-row justify-center items-center p-4'>
|
export default Layout;
|
||||||
<span className='loading loading-spinner loading-xl' />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Suspense>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,21 +1,11 @@
|
|||||||
'use client';
|
import SuspenseHelper from '@/components/helper/SuspenseHelper';
|
||||||
|
|
||||||
import { Suspense } from 'react';
|
const Layout = ({
|
||||||
|
|
||||||
export default function NonstockLayout({
|
|
||||||
children,
|
children,
|
||||||
}: {
|
}: Readonly<{
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}>) => {
|
||||||
return (
|
return <SuspenseHelper>{children}</SuspenseHelper>;
|
||||||
<Suspense
|
};
|
||||||
fallback={
|
|
||||||
<div className='w-full flex flex-row justify-center items-center p-4'>
|
export default Layout;
|
||||||
<span className='loading loading-spinner loading-xl' />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Suspense>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,21 +1,11 @@
|
|||||||
'use client';
|
import SuspenseHelper from '@/components/helper/SuspenseHelper';
|
||||||
|
|
||||||
import { Suspense } from 'react';
|
const Layout = ({
|
||||||
|
|
||||||
export default function ProductCategoryLayout({
|
|
||||||
children,
|
children,
|
||||||
}: {
|
}: Readonly<{
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}>) => {
|
||||||
return (
|
return <SuspenseHelper>{children}</SuspenseHelper>;
|
||||||
<Suspense
|
};
|
||||||
fallback={
|
|
||||||
<div className='w-full flex flex-row justify-center items-center p-4'>
|
export default Layout;
|
||||||
<span className='loading loading-spinner loading-xl' />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Suspense>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,21 +1,11 @@
|
|||||||
'use client';
|
import SuspenseHelper from '@/components/helper/SuspenseHelper';
|
||||||
|
|
||||||
import { Suspense } from 'react';
|
const Layout = ({
|
||||||
|
|
||||||
export default function ProductLayout({
|
|
||||||
children,
|
children,
|
||||||
}: {
|
}: Readonly<{
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}>) => {
|
||||||
return (
|
return <SuspenseHelper>{children}</SuspenseHelper>;
|
||||||
<Suspense
|
};
|
||||||
fallback={
|
|
||||||
<div className='w-full flex flex-row justify-center items-center p-4'>
|
export default Layout;
|
||||||
<span className='loading loading-spinner loading-xl' />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Suspense>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,17 +1,11 @@
|
|||||||
'use client';
|
import SuspenseHelper from '@/components/helper/SuspenseHelper';
|
||||||
|
|
||||||
import { Suspense } from 'react';
|
const Layout = ({
|
||||||
|
children,
|
||||||
|
}: Readonly<{
|
||||||
|
children: React.ReactNode;
|
||||||
|
}>) => {
|
||||||
|
return <SuspenseHelper>{children}</SuspenseHelper>;
|
||||||
|
};
|
||||||
|
|
||||||
export default function UomLayout({ children }: { children: React.ReactNode }) {
|
export default Layout;
|
||||||
return (
|
|
||||||
<Suspense
|
|
||||||
fallback={
|
|
||||||
<div className='w-full flex flex-row justify-center items-center p-4'>
|
|
||||||
<span className='loading loading-spinner loading-xl' />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Suspense>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,21 +1,11 @@
|
|||||||
'use client';
|
import SuspenseHelper from '@/components/helper/SuspenseHelper';
|
||||||
|
|
||||||
import { Suspense } from 'react';
|
const Layout = ({
|
||||||
|
|
||||||
export default function WarehouseLayout({
|
|
||||||
children,
|
children,
|
||||||
}: {
|
}: Readonly<{
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}>) => {
|
||||||
return (
|
return <SuspenseHelper>{children}</SuspenseHelper>;
|
||||||
<Suspense
|
};
|
||||||
fallback={
|
|
||||||
<div className='w-full flex flex-row justify-center items-center p-4'>
|
export default Layout;
|
||||||
<span className='loading loading-spinner loading-xl' />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</Suspense>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import { Suspense } from 'react';
|
||||||
|
|
||||||
|
const SuspenseHelper = ({
|
||||||
|
children,
|
||||||
|
}: Readonly<{
|
||||||
|
children: React.ReactNode;
|
||||||
|
}>) => {
|
||||||
|
return (
|
||||||
|
<Suspense
|
||||||
|
fallback={
|
||||||
|
<div className='w-full flex flex-row justify-center items-center p-4'>
|
||||||
|
<span className='loading loading-spinner loading-xl' />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</Suspense>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default SuspenseHelper;
|
||||||
Reference in New Issue
Block a user