Code block collapses as well as expands
This commit is contained in:
@@ -58,13 +58,13 @@ export default function CodeBlock({
|
||||
variant="slate"
|
||||
/>
|
||||
)}
|
||||
{isCollapsed && (
|
||||
{maxHeight && (
|
||||
<div className="absolute left-0 bottom-0 w-full flex items-center justify-center bg-gradient-to-b from-transparent to-[#0F172A]">
|
||||
<button
|
||||
className="bg-slate-800 rounded-full py-1 px-2 text-xs mb-1"
|
||||
className="bg-slate-800 rounded-full py-2 px-3 text-xs mb-1 hover:bg-slate-700 transition"
|
||||
onClick={(e) => setIsCollapsed((s) => !s)}
|
||||
>
|
||||
Expand
|
||||
{isCollapsed ? "Expand" : "Collapse"}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user