MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / columnWidths

Function columnWidths

cli/src/components/choice-ad-banner.tsx:59–63  ·  view source on GitHub ↗

* Calculate evenly distributed column widths that sum exactly to availableWidth. * Distributes remainder pixels across the first N columns so there's no gap.

(count: number, availableWidth: number)

Source from the content-addressed store, hash-verified

57 * Distributes remainder pixels across the first N columns so there's no gap.
58 */
59function columnWidths(count: number, availableWidth: number): number[] {
60 const base = Math.floor(availableWidth / count)
61 const remainder = availableWidth - base * count
62 return Array.from({ length: count }, (_, i) => base + (i < remainder ? 1 : 0))
63}
64
65export const ChoiceAdBanner: React.FC<ChoiceAdBannerProps> = ({
66 ads,

Callers 1

ChoiceAdBannerFunction · 0.85

Calls 1

fromMethod · 0.80

Tested by

no test coverage detected