@@ -2,10 +2,6 @@ import React from "react";
22import Link from "next/link" ;
33import { useRouter } from "next/router" ;
44import {
5- Tabs ,
6- TabsHeader ,
7- Tab ,
8- Typography ,
95 Tooltip ,
106 IconButton ,
117 Button ,
@@ -15,14 +11,11 @@ import {
1511 MenuItem ,
1612} from "@material-tailwind/react" ;
1713import {
18- EyeIcon ,
19- CodeBracketIcon ,
2014 ClipboardDocumentListIcon ,
2115 ClipboardDocumentCheckIcon ,
2216 ChevronDownIcon ,
2317} from "@heroicons/react/24/outline" ;
2418import copyToClipboard from "utils/copy-to-clipboard" ;
25- import { v4 as uuidv4 } from "uuid" ;
2619
2720export function CodePreview ( { id, component, link, children, className } ) {
2821 const codeRef = React . useRef ( null ) ;
@@ -40,7 +33,7 @@ export function CodePreview({ id, component, link, children, className }) {
4033 return (
4134 < div
4235 id = { id }
43- className = { `scroll-mt-64 rounded-xl border border-blue-gray-50 ${
36+ className = { `scroll-mt-64 overflow-hidden rounded-xl border border-blue-gray-50 ${
4437 mode === "code" ? "bg-[#1e293b]" : "bg-[#f8fafc]"
4538 } ${ className || "" } `}
4639 >
@@ -144,7 +137,7 @@ export function CodePreview({ id, component, link, children, className }) {
144137 < div className = "grid min-h-[140px] w-full place-items-center overflow-x-scroll rounded-lg p-6 lg:overflow-visible" >
145138 { component }
146139 </ div >
147- < div className = "code-preview block" >
140+ < div className = "code-preview block max-h-[40rem] overflow-scroll rounded-b-xl " >
148141 { React . cloneElement ( children , { ref : codeRef } ) }
149142 </ div >
150143 </ div >
0 commit comments