({ version, count, place }: FixtureState)
| 101 | } |
| 102 | |
| 103 | function BenchmarkFixture({ version, count, place }: FixtureState) { |
| 104 | const TooltipComponent = version === 'v5' ? TooltipV5 : TooltipV6 |
| 105 | const tooltipId = `benchmark-tooltip-${version}` |
| 106 | |
| 107 | const anchorIds = useMemo( |
| 108 | () => Array.from({ length: count }, (_, index) => `anchor-${version}-${index}`), |
| 109 | [count, version], |
| 110 | ) |
| 111 | |
| 112 | useEffect(() => { |
| 113 | document.body.setAttribute('data-benchmark-count', String(count)) |
| 114 | document.body.setAttribute('data-benchmark-version', version) |
| 115 | }, [count, version]) |
| 116 | |
| 117 | return ( |
| 118 | <div className="benchmark-surface" aria-hidden="true"> |
| 119 | <div className="anchor-grid"> |
| 120 | {anchorIds.map((id, index) => ( |
| 121 | <button |
| 122 | key={id} |
| 123 | id={id} |
| 124 | className="anchor" |
| 125 | data-tooltip-id={tooltipId} |
| 126 | data-tooltip-content={`Anchor ${index}`} |
| 127 | type="button" |
| 128 | > |
| 129 | {index} |
| 130 | </button> |
| 131 | ))} |
| 132 | </div> |
| 133 | <TooltipComponent id={tooltipId} place={place} /> |
| 134 | </div> |
| 135 | ) |
| 136 | } |
| 137 | |
| 138 | const rootNode = document.getElementById('root') |
| 139 |
nothing calls this directly
no outgoing calls
no test coverage detected