import type { Config, DriveStep } from "driver.js"; import { driver } from "driver.js"; import "driver.js/dist/driver.css"; type CodeSampleProps = { heading: string; config?: Config; highlight?: DriveStep; tour?: DriveStep[]; id?: string; className?: string; children: any; }; export function CodeSample(props: CodeSampleProps) { const { heading, id, children, className, config, highlight, tour } = props; function onClick() { if (highlight) { const driverObj = driver(); driverObj.highlight(highlight); } else if (tour) { const driverObj = driver({ ...config, steps: tour, }); driverObj.drive(); } } return (

{ heading }

{children}
); }