MCPcopy Create free account
hub / github.com/dailydotdev/apps / BoostsTable

Function BoostsTable

packages/shared/src/features/boost/BoostManager.tsx:361–469  ·  view source on GitHub ↗
({
  campaigns,
  onStop,
  onBoostAgain,
  blinkingId,
}: {
  campaigns: Campaign[];
  onStop: (campaign: Campaign) => void;
  onBoostAgain: (campaign: Campaign) => void;
  blinkingId?: string;
})

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

largeNumberFormatFunction · 0.90
onBoostAgainFunction · 0.85

Tested by

no test coverage detected