"use client"; import React, { useState, useEffect } from "react"; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@/components/ui/card"; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@/components/ui/collapsible"; import { Label } from "@/components/ui/label"; import { Switch } from "@/components/ui/switch"; import { CopyButton } from "./copy-button"; import SyntaxHighlighter from "react-syntax-highlighter"; import { atomOneDark } from "react-syntax-highlighter/dist/esm/styles/hljs"; const CardSnippet = ({ title, code, children }: { title: string, code: string, children: React.ReactNode }) => { const [show, setShow] = useState(false); const toggle = () => { setShow(!show); }; return ( {title && ( {title} )} {code && (
)}
{children}
{`${code}`}
); }; export default CardSnippet;