mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-02-08 18:39:31 +08:00
22 lines
517 B
TypeScript
22 lines
517 B
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
|
|
import { cn } from "@/lib/utils"
|
|
import { CodeBlockWrapper } from "@/components/code-block-wrapper"
|
|
|
|
interface ComponentSourceProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
src: string
|
|
}
|
|
|
|
export function ComponentSource({ children, className }: ComponentSourceProps) {
|
|
return (
|
|
<CodeBlockWrapper
|
|
expandButtonTitle="View Primitive"
|
|
className={cn("my-6 overflow-hidden rounded-md", className)}
|
|
>
|
|
{children}
|
|
</CodeBlockWrapper>
|
|
)
|
|
}
|