mirror of
https://github.com/supabase/supabase.git
synced 2026-10-16 14:49:10 +03:00
* add package manager selection * Save the package manager selection to local storage. * Add a comment for the dynamic import. --------- Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
28 lines
867 B
TypeScript
28 lines
867 B
TypeScript
import { OpenInV0Button } from '@/components/open-in-v0-button'
|
|
|
|
import dynamic from 'next/dynamic'
|
|
|
|
//The dynamic import is to prevent the command component from being rendered on the server and cause hydration errors
|
|
const Command = dynamic(() => import('./command').then((mod) => mod.Command), { ssr: false })
|
|
|
|
interface BlockItemProps {
|
|
name: string
|
|
}
|
|
|
|
export const BlockItem = ({ name }: BlockItemProps) => {
|
|
return (
|
|
<div className="mt-4">
|
|
<Command name={name} highlight />
|
|
<OpenInV0Button name={name} className="w-fit shrink-0 mt-4" />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export const BlockItemPreview = ({ title, src }: { title: string; src: string }) => {
|
|
return (
|
|
<div className="flex items-center justify-center relative border rounded-lg">
|
|
<iframe src={src} className="w-full h-[600px] border-0 rounded-md" title={title} />
|
|
</div>
|
|
)
|
|
}
|