({
campaigns,
onStop,
onBoostAgain,
blinkingId,
}: {
campaigns: Campaign[];
onStop: (campaign: Campaign) => void;
onBoostAgain: (campaign: Campaign) => void;
blinkingId?: string;
})
| 366 | const columns = ['Boost', 'Spend', 'Impressions', 'New members', 'Time', '']; |
| 367 | |
| 368 | const BoostsTable = ({ |
| 369 | campaigns, |
| 370 | onStop, |
| 371 | onBoostAgain, |
| 372 | blinkingId, |
| 373 | }: { |
| 374 | campaigns: Campaign[]; |
| 375 | onStop: (campaign: Campaign) => void; |
| 376 | onBoostAgain: (campaign: Campaign) => void; |
| 377 | blinkingId?: string; |
| 378 | }): ReactElement => ( |
| 379 | <table className="w-full table-auto border-collapse text-left"> |
| 380 | <thead> |
| 381 | <tr className="border-y border-border-subtlest-tertiary bg-surface-float"> |
| 382 | {columns.map((column, index) => ( |
| 383 | <th |
| 384 | key={column || 'actions'} |
| 385 | scope="col" |
| 386 | className={classNames( |
| 387 | 'whitespace-nowrap px-3 py-2 font-bold uppercase tracking-wider text-text-tertiary typo-caption2', |
| 388 | index === 0 && |
| 389 | classNames(stickyHeadClassName, 'w-full pl-4 tablet:pl-6'), |
| 390 | index > 0 && index < 4 && 'text-right', |
| 391 | )} |
| 392 | > |
| 393 | {column} |
| 394 | </th> |
| 395 | ))} |
| 396 | </tr> |
| 397 | </thead> |
| 398 | <tbody> |
| 399 | {campaigns.map((campaign) => { |
| 400 | const { flags } = campaign; |
| 401 | |
| 402 | return ( |
| 403 | <tr |
| 404 | key={campaign.id} |
| 405 | data-campaign-id={campaign.id} |
| 406 | className={classNames( |
| 407 | 'group border-b border-border-subtlest-tertiary transition-colors last:border-b-0 hover:bg-surface-hover', |
| 408 | campaign.id === blinkingId && '[&>td]:animate-row-blink', |
| 409 | )} |
| 410 | > |
| 411 | <td |
| 412 | className={classNames( |
| 413 | stickyCellClassName, |
| 414 | 'max-w-0 py-3 pl-4 pr-3 tablet:pl-6', |
| 415 | )} |
| 416 | > |
| 417 | <BoostName campaign={campaign} /> |
| 418 | </td> |
| 419 | <td className={cellClassName}> |
| 420 | <span className="inline-flex items-center gap-1"> |
| 421 | <CoreIcon size={IconSize.Size16} /> |
| 422 | {largeNumberFormat(flags.spend ?? 0)} |
| 423 | </span> |
| 424 | </td> |
| 425 | <td className={cellClassName}> |
nothing calls this directly
no test coverage detected