app-03
simple-ai/app-03FreeBlock
An X profile bio generator app.
Live preview
live · rendered by the registry
Rendered by simple-ai on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://simple-ai.dev/r/app-03.jsonSource
1"use client";23import { useCompletion } from "@ai-sdk/react";4import type { DeepPartial } from "ai";5import { useEffect, useState } from "react";6import type { z } from "zod";7import { ProfileGenerateDialog } from "@/registry/blocks/app-03/components/profile-generate-dialog";8import { Toolbar } from "@/registry/blocks/app-03/components/toolbar";9import { XPreview } from "@/registry/blocks/app-03/components/x-preview";10import type {11 profileGenerationSchema,12 XProfile,13} from "@/registry/blocks/app-03/lib/x";1415export default function XProfileGenerator() {16 const [profile, setProfile] = useState<DeepPartial<XProfile>>({});1718 const { isLoading, complete, completion } = useCompletion({19 api: "/api/ai/x-profile",20 onFinish: (_prompt, completion) => {21 setProfile((profile) => ({22 ...profile,23 bio: completion,24 }));25 },26 experimental_throttle: 90,27 });2829 useEffect(() => {30 if (completion) {31 setProfile((profile) => ({32 ...profile,33 bio: completion,34 }));35 }36 }, [completion]);3738 function onSubmit(values: z.infer<typeof profileGenerationSchema>) {39 setProfile({40 displayName: values.displayName,41 username: values.username,42 });43 complete(JSON.stringify(values));44 }4546 return (47 <div className="min-h-screen bg-black text-white">48 <Toolbar />49 <XPreview50 profile={profile}51 isLoading={isLoading}52 generateDialog={<ProfileGenerateDialog onSubmit={onSubmit} />}53 />54 </div>55 );56}
What it pulls in
npm packages
Other registry items
Files it writes
More from simple-ai
All 77 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| app-01app-01 | simple-ai | Blocks | Free | 5 deps · 11 files | |
| app-02app-02 | simple-ai | Blocks | Free | 3 deps · 5 files | |
| chat-01chat-01 | simple-ai | Blocks | Free | 3 deps · 16 files | |
| chat-02chat-02 | simple-ai | Blocks | Free | 2 deps · 3 files | |
| chat-03chat-03 | simple-ai | Blocks | Free | 2 deps · 3 files | |
| chat-04chat-04 | simple-ai | Blocks | Free | 3 deps · 13 files | |
| flow-chainflow-chain | simple-ai | Blocks | Free | 8 deps · 19 files | |
| flow-orchestratorflow-orchestrator | simple-ai | Blocks | Free | 8 deps · 19 files |
