"use client"; import clsx from "clsx"; import { useState } from "react"; import { useFocus } from "react-aria"; import CopyIcon from "../../icons/copy"; import { useToasts } from "../Toast"; import styles from "./Snippet.module.css"; interface Props { prompt?: boolean; text: string | string[]; width?: React.CSSProperties["width"]; display?: string; type?: "success" | "error" | "warning" | "secondary" | "lite"; fill?: boolean; } const Snippet: React.ComponentType = ({ prompt = true, width, text, type, fill, }) => { const toasts = useToasts(); const [focused, setFocused] = useState(false); const { focusProps } = useFocus({ onFocusChange: setFocused, }); return (
{Array.isArray(text) ? ( text.map((e, i) => { const key = `${e}-${i}`; return (
              {e}
            
); }) ) : (
{text}
)}
); }; export default Snippet;