({ children }: { children: React.ReactNode })
| 54 | |
| 55 | |
| 56 | export function GuildPagesWrapper({ children }: { children: React.ReactNode }) { |
| 57 | let guild = useCurrentGuild(); |
| 58 | if (guild?.loading || guild?.waiting) { |
| 59 | return <Loading /> |
| 60 | } |
| 61 | |
| 62 | if (guild?.value) { |
| 63 | if (guild.value.connected) { |
| 64 | return <> |
| 65 | {children} |
| 66 | </> |
| 67 | } else { |
| 68 | return <div className="page-wrapper"> |
| 69 | <InviteGuildPage guild={guild.value} /> |
| 70 | </div> |
| 71 | } |
| 72 | } else { |
| 73 | return <div className="page-wrapper"> |
| 74 | <NoGuildPage /> |
| 75 | </div> |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | |
| 80 | function InviteGuildPage(props: { guild: BotGuild }) { |
nothing calls this directly
no test coverage detected