import { ErrorBoundary, For, Suspense } from "solid-js"; import { Trans } from "@lingui-solid/solid/macro"; import { useClient } from "@revolt/client"; import { createOwnBotsResource } from "@revolt/client/resources"; import { useModals } from "@revolt/modal"; import { Avatar, CategoryButton, CategoryButtonGroup, CircularProgress, Column, iconSize, } from "@revolt/ui"; import MdLibraryBooks from "@material-design-icons/svg/outlined/library_books.svg?component-solid"; import MdSmartToy from "@material-design-icons/svg/outlined/smart_toy.svg?component-solid"; import { useSettingsNavigation } from "../../Settings"; /** * View all owned bots */ export function MyBots() { return ( ); } /** * Prompt to create a new bot */ function CreateBot() { const client = useClient(); const { openModal } = useModals(); const { navigate } = useSettingsNavigation(); return ( } onClick={() => openModal({ type: "create_bot", client: client(), onCreate(bot) { navigate(`bots/${bot.id}`); }, }) } description={ You agree that your bot is subject to the Acceptable Usage Policy. } > Create Bot } onClick={() => window.open("https://developers.stoat.chat", "_blank")} description={ Learn more about how to create bots on Stoat. } > Developer Documentation ); } /** * List owned bots by current user */ function ListBots() { const { navigate } = useSettingsNavigation(); const bots = createOwnBotsResource(); return ( }> {(bot) => ( } onClick={() => navigate(`bots/${bot.id}`)} action="chevron" // description={bot.id} > {bot.user!.displayName} )} ); }