1
Fork 0
mirror of https://github.com/Steffo99/festa.git synced 2024-12-22 22:54:22 +00:00
festa/components/generic/loading/boundaries.tsx

26 lines
597 B
TypeScript
Raw Permalink Normal View History

import { ReactNode, Suspense } from "react"
import { LoadingInline, LoadingMain } from "./renderers"
export type LoadingBoundaryProps = {
text?: string,
children: ReactNode,
}
export function LoadingBoundaryMain({ text, children }: LoadingBoundaryProps) {
return (
<Suspense fallback={<LoadingMain text={text} />}>
{children}
</Suspense>
)
}
export function LoadingBoundaryInline({ text, children }: LoadingBoundaryProps) {
return (
<Suspense fallback={<LoadingInline text={text} />}>
{children}
</Suspense>
)
}