mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
0a06061def
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
21 lines
708 B
TypeScript
21 lines
708 B
TypeScript
import {Tabs, Tab} from "@/components/react/tabs"
|
|
import { Frame } from "@/components/react/frame"
|
|
|
|
export function ImageAndCode({ preview, children, id }: { preview: string | React.ReactNode; children: React.ReactNode, id: string }) {
|
|
return (
|
|
<Tabs groupId={id} items={["Preview", "Code"]}>
|
|
<Tab value="Preview">
|
|
{typeof preview === "string" ?
|
|
<Frame>
|
|
<img className="rounded-lg w-full" src={preview} />
|
|
</Frame>
|
|
:
|
|
preview
|
|
}
|
|
</Tab>
|
|
<Tab value="Code">
|
|
{children}
|
|
</Tab>
|
|
</Tabs>
|
|
)
|
|
} |