PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 All 256 releases
give / src / Admin / components / SummaryTable / index.tsx

index.tsx in GiveWP – Donation Plugin and Fundraising Platform 4.17.0, at src/Admin/components/SummaryTable/index.tsx

50 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React from 'react';
2 import classnames from 'classnames';
3 import Spinner from '@givewp/src/Admin/components/Spinner';
4 import styles from './styles.module.scss';
5
6 /**
7 * @since 4.8.0 abstracted from DonorSummary to be used with other components. Add ReactNode support.
8 * @since 4.5.0
9 */
10 export type SummaryItem = {
11 label: string;
12 value: string | React.ReactNode;
13 isPill?: boolean;
14 };
15
16 /**
17 * @since 4.8.0
18 */
19 interface SummaryTableProps {
20 title?: string;
21 subtitle?: string;
22 data: SummaryItem[];
23 isLoading?: boolean;
24 }
25
26 /**
27 * @since 4.8.0
28 */
29 export default function SummaryTable({data, isLoading}: SummaryTableProps) {
30 return (
31 <div className={styles.summaryTableContainer}>
32 {data.map((item, index) => (
33 <div className={styles.summaryTable} key={index}>
34 <p className={styles.summaryTableLabel}>{item.label}</p>
35 {isLoading ? (
36 <Spinner />
37 ) : (
38 <strong className={classnames(styles.summaryTableValue, {
39 [styles.pill]: item.isPill,
40 })}>
41 {item.value}
42 </strong>
43 )}
44 </div>
45 ))}
46 </div>
47 );
48 }
49
50