mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
feat: use fallback with loading
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
import { Skeleton } from '@mantine/core';
|
||||
import { useRouter } from 'next/router';
|
||||
import { DocContainer } from '../DocContainer';
|
||||
import { MethodsSection, PropertiesSection } from '../Sections';
|
||||
import type { ApiInterfaceJSON } from '~/DocModel/ApiNodeJSONEncoder';
|
||||
|
||||
export function Interface({ data }: { data: ApiInterfaceJSON }) {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<DocContainer
|
||||
name={data.name}
|
||||
@@ -13,8 +17,12 @@ export function Interface({ data }: { data: ApiInterfaceJSON }) {
|
||||
methods={data.methods}
|
||||
properties={data.properties}
|
||||
>
|
||||
<PropertiesSection data={data.properties} />
|
||||
<MethodsSection data={data.methods} />
|
||||
<Skeleton visible={router.isFallback}>
|
||||
<PropertiesSection data={data.properties} />
|
||||
</Skeleton>
|
||||
<Skeleton visible={router.isFallback}>
|
||||
<MethodsSection data={data.methods} />
|
||||
</Skeleton>
|
||||
</DocContainer>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user