import * as React from 'react';
import type { RegistryItem } from 'shadcn/schema';
import { BlockViewer } from '@/components/block-viewer';
import {
getCachedDependencies,
getCachedFileTree,
getCachedHighlightedFiles,
getCachedRegistryItem,
} from '@/lib/registry-cache';
export function BlockDisplay(props: {
item: RegistryItem & {
meta?: {
descriptionSrc?: string;
isPro?: boolean;
src?: string;
};
};
}) {
return (
);
}
async function BlockDisplayContent({
item: block,
}: {
item: RegistryItem & {
meta?: {
descriptionSrc?: string;
isPro?: boolean;
src?: string;
};
};
}) {
if (block.meta?.src) {
return (
);
}
const item = await getCachedRegistryItem(block.name);
if (!item?.files) {
return null;
}
const tree = getCachedFileTree(item.files);
const dependencies = getCachedDependencies(block.name);
const highlightedFiles = await getCachedHighlightedFiles(item.files);
return (
);
}