diff --git a/src/App.tsx b/src/App.tsx index f3f87b0..8aba761 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -204,9 +204,9 @@ const App = () => { - - +
+ +
}>
diff --git a/src/components/common/ReportSkeleton.tsx b/src/components/common/ReportSkeleton.tsx new file mode 100644 index 0000000..323196b --- /dev/null +++ b/src/components/common/ReportSkeleton.tsx @@ -0,0 +1,126 @@ +import React from 'react'; + +interface ReportSkeletonProps { + summaryCardCount?: number; + tableColumnCount?: number; + tableRowCount?: number; + showMethodSummaries?: boolean; + showChart?: boolean; + showPaymentTypeCards?: boolean; +} + +export const ReportSkeleton: React.FC = ({ + summaryCardCount = 4, + tableColumnCount = 7, + tableRowCount = 5, + showMethodSummaries = false, + showChart = false, + showPaymentTypeCards = false, +}) => { + return ( + <> + {/* Summary Cards Skeleton */} +
+ {[...Array(summaryCardCount)].map((_, i) => ( +
+
+
+
+
+
+
+
+
+ ))} +
+ + {/* Method Summaries Skeleton */} + {showMethodSummaries && ( +
+
+
+ {[...Array(3)].map((_, i) => ( +
+
+
+ {[...Array(6)].map((_, j) => ( +
+
+
+
+ ))} +
+
+ ))} +
+
+ )} + + {/* Pie Chart and Total Amount Skeleton */} + {showChart && ( +
+
+
+
+
+
+
+
+
+
+
+ )} + + {/* Payment Type Cards Skeleton */} + {showPaymentTypeCards && ( +
+
+
+ {[...Array(5)].map((_, i) => ( +
+
+
+ {[...Array(5)].map((_, j) => ( +
+
+
+
+ ))} +
+
+ ))} +
+
+ )} + + {/* Table Skeleton */} +
+
+ + + + {[...Array(tableColumnCount)].map((_, i) => ( + + ))} + + + + {[...Array(tableRowCount)].map((_, i) => ( + + {[...Array(tableColumnCount)].map((_, j) => ( + + ))} + + ))} + +
+
+
+
+
+
+
+ + ); +}; + diff --git a/src/components/ui/ToggleSwitch.tsx b/src/components/ui/ToggleSwitch.tsx new file mode 100644 index 0000000..d6ad1fb --- /dev/null +++ b/src/components/ui/ToggleSwitch.tsx @@ -0,0 +1,41 @@ +import React from 'react'; + +interface ToggleSwitchProps { + checked: boolean; + onChange: (checked: boolean) => void; + disabled?: boolean; + className?: string; +} + +export const ToggleSwitch: React.FC = ({ + checked, + onChange, + disabled = false, + className = '', +}) => { + return ( +