Skip to content

Commit 3e47117

Browse files
committed
Detailed CCI Report
1 parent faeb408 commit 3e47117

File tree

9 files changed

+502
-621
lines changed

9 files changed

+502
-621
lines changed

next.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ const nextConfig = {
2424
},
2525
// Set the base path to match your GitHub repo name if needed
2626
// For example: basePath: '/cci',
27-
basePath: '/cci',
27+
// Comment out for local development
28+
// basePath: '/cci',
2829
// Set asset prefix to match your GitHub repo if needed
29-
assetPrefix: '/cci',
30+
// Comment out for local development
31+
// assetPrefix: '/cci',
3032
}
3133

3234
module.exports = nextConfig

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"license": "ISC",
1414
"description": "Cyber Capability Index Calculator",
1515
"dependencies": {
16+
"@heroicons/react": "^2.2.0",
1617
"chart.js": "^4.4.1",
1718
"docx": "^9.4.1",
1819
"file-saver": "^2.0.5",

src/app/page.tsx

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import AnnexureKForm from '../components/AnnexureKForm';
99
import { initialCCIParameters, generateSampleData } from './data/cciParameters';
1010
import { CCIParameter, CCIResult, AnnexureKData } from './types';
1111
import { calculateCCIIndex } from './utils/cciCalculator';
12-
import { exportToPDF } from './utils/exportUtils';
12+
import { exportToWord } from './utils/exportUtils';
1313
import DataCollectionForm from '../components/DataCollectionForm';
1414
import { FormState as AnnexureKFormState } from '../components/AnnexureKForm';
1515
import { toast } from 'react-hot-toast';
@@ -83,26 +83,26 @@ export default function Home() {
8383
}, 100);
8484
};
8585

86-
const handleExportPDF = () => {
87-
// Show loading indicator while PDF is being generated
86+
const handleExportWord = () => {
87+
// Show loading indicator while Word document is being generated
8888
setIsExporting(true);
8989

9090
try {
9191
// Export the full detailed report with parameters, result and annexureKData
92-
exportToPDF(parameters, cciResult, annexureKData || undefined)
92+
exportToWord(parameters, cciResult, annexureKData || undefined)
9393
.then(() => {
9494
setIsExporting(false);
95-
toast.success('Report exported successfully!');
95+
toast.success('Word document exported successfully!');
9696
})
9797
.catch(error => {
98-
console.error('Error exporting PDF:', error);
98+
console.error('Error exporting Word document:', error);
9999
setIsExporting(false);
100-
toast.error('Failed to export report');
100+
toast.error('Failed to export Word document');
101101
});
102102
} catch (error) {
103-
console.error('Error starting PDF export:', error);
103+
console.error('Error starting Word export:', error);
104104
setIsExporting(false);
105-
toast.error('Failed to start PDF export');
105+
toast.error('Failed to start Word export');
106106
}
107107
};
108108

@@ -286,7 +286,7 @@ export default function Home() {
286286
</button>
287287
<button
288288
onClick={handleShowAnnexureK}
289-
className="bg-blue-600 hover:bg-blue-700 text-white py-2 px-6 rounded-md transition duration-200 shadow-md flex items-center"
289+
className="bg-gray-800 hover:bg-black text-white py-2 px-6 rounded-md transition duration-200 shadow-md flex items-center"
290290
>
291291
<svg xmlns="http://www.w3.org/2000/svg" className="h-5 w-5 mr-2" viewBox="0 0 20 20" fill="currentColor">
292292
<path fillRule="evenodd" d="M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z" clipRule="evenodd" />
@@ -314,7 +314,7 @@ export default function Home() {
314314
<div className="p-6">
315315
{Object.keys(groupedParameters).map((category, categoryIndex) => (
316316
<div key={categoryIndex} className="mb-8">
317-
<h3 className="text-lg font-medium text-white mb-4 pb-2 border-b">
317+
<h3 className="text-lg font-medium text-black mb-4 pb-2 border-b">
318318
{getCategoryName(category)} Parameters
319319
</h3>
320320

@@ -360,7 +360,7 @@ export default function Home() {
360360
{showResults && (
361361
<div id="results" className="bg-white rounded-xl shadow-md overflow-hidden mb-8 animate-fadeIn">
362362
<div className="p-6 bg-gray-50 border-b">
363-
<h2 className="text-xl font-semibold text-blue-800">CCI Results</h2>
363+
<h2 className="text-xl font-semibold text-black">CCI Results</h2>
364364
</div>
365365
<div className="p-6">
366366
<CCIResults result={cciResult} onViewReport={handleViewReport} onReset={handleReset} onShowAnnexureK={handleShowAnnexureK} />
@@ -373,9 +373,9 @@ export default function Home() {
373373
<div className="bg-white rounded-xl shadow-md overflow-hidden mb-4">
374374
<div className="p-6 bg-gray-50 border-b">
375375
<div>
376-
<h2 className="text-xl font-semibold text-blue-800">CCI Detailed Report</h2>
376+
<h2 className="text-xl font-semibold text-black">CCI Detailed Report</h2>
377377
{annexureKData && (
378-
<p className="text-sm text-green-600 mt-1">
378+
<p className="text-sm text-black mt-1">
379379
<svg xmlns="http://www.w3.org/2000/svg" className="h-4 w-4 inline-block mr-1" viewBox="0 0 20 20" fill="currentColor">
380380
<path fillRule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clipRule="evenodd" />
381381
</svg>
@@ -385,21 +385,34 @@ export default function Home() {
385385
</div>
386386
</div>
387387
</div>
388-
<CCIReport parameters={parameters} result={cciResult} />
388+
<CCIReport parameters={parameters} result={cciResult} onExportWord={handleExportWord} />
389389
</div>
390390
)}
391391

392+
{/* Bottom Calculate CCI Button */}
393+
<div className="flex justify-center mb-12">
394+
<button
395+
onClick={handleCalculate}
396+
className="bg-black hover:bg-gray-800 text-white py-3 px-8 rounded-lg transition duration-200 shadow-lg flex items-center text-lg font-bold"
397+
>
398+
<svg xmlns="http://www.w3.org/2000/svg" className="h-6 w-6 mr-2" viewBox="0 0 20 20" fill="currentColor">
399+
<path fillRule="evenodd" d="M6.267 3.455a3.066 3.066 0 001.745-.723 3.066 3.066 0 013.976 0 3.066 3.066 0 001.745.723 3.066 3.066 0 012.812 2.812c.051.643.304 1.254.723 1.745a3.066 3.066 0 010 3.976 3.066 3.066 0 00-.723 1.745 3.066 3.066 0 01-2.812 2.812 3.066 3.066 0 00-1.745.723 3.066 3.066 0 01-3.976 0 3.066 3.066 0 00-1.745-.723 3.066 3.066 0 01-2.812-2.812 3.066 3.066 0 00-.723-1.745 3.066 3.066 0 010-3.976 3.066 3.066 0 00.723-1.745 3.066 3.066 0 012.812-2.812zm7.44 5.252a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clipRule="evenodd" />
400+
</svg>
401+
Calculate CCI Score
402+
</button>
403+
</div>
404+
392405
{/* Bottom Call-to-Action for Implementation Guide */}
393-
<div className="bg-blue-900 text-white p-6 rounded-xl shadow-lg mb-8 flex flex-col md:flex-row items-center justify-between">
406+
<div className="bg-black text-white p-6 rounded-xl shadow-lg mb-8 flex flex-col md:flex-row items-center justify-between">
394407
<div className="mb-4 md:mb-0">
395408
<h2 className="text-xl font-bold">Need guidance for SEBI CSCRF implementation?</h2>
396-
<p className="text-blue-200 mt-2">
409+
<p className="text-gray-300 mt-2">
397410
Our comprehensive guide provides detailed requirements and evidence examples for each parameter
398411
</p>
399412
</div>
400413
<a
401414
href="https://dakshinrajsiva.github.io/cci/sebi-cscrf"
402-
className="bg-white text-blue-900 hover:bg-blue-100 py-3 px-8 rounded-md transition duration-200 font-bold flex items-center shadow-md"
415+
className="bg-white text-black hover:bg-gray-200 py-3 px-8 rounded-md transition duration-200 font-bold flex items-center shadow-md"
403416
target="_blank"
404417
rel="noopener noreferrer"
405418
>

0 commit comments

Comments
 (0)