Sha256: 7dac9d8e4b132851b9648a1dd801611487d6f49e159b53e232611a51a8cd0436
Contents?: true
Size: 862 Bytes
Versions: 45
Compression:
Stored size: 862 Bytes
Contents
import React from "react" //CollapsibleTrail component const CollapsibleTrail = ({ leftOffset }: { leftOffset: number }) => { const style: { [key: string]: string | number } = { position: "absolute", left: `${leftOffset}em`, top: 0, bottom: 0, width: "2px", backgroundColor: "#E4E8F0", } return <div style={style} /> } // Updated function to render multiple trails depending on depth export const renderCollapsibleTrail = (currentDepth: number) => { const lines = [] for (let i = 1; i <= currentDepth; i++) { // Calculate leftOffset with additional 0.4rem for each depth level above 1 const additionalOffset = i > 1 ? (i - 1) * 0.25 : 0 const leftOffset = i * 1.0 + additionalOffset lines.push(<CollapsibleTrail key={i} leftOffset={leftOffset} /> ) } return lines }
Version data entries
45 entries across 45 versions & 1 rubygems