hakeemsyd commited on
Commit
f81dc34
1 Parent(s): cdfba46

statements list

Browse files
app/(home)/dashboard/page.tsx CHANGED
@@ -50,6 +50,11 @@ const Dashboard = () => {
50
  dataIndex: 'category',
51
  key: 'category',
52
  },
 
 
 
 
 
53
  ];
54
 
55
 
 
50
  dataIndex: 'category',
51
  key: 'category',
52
  },
53
+ {
54
+ title: 'Type',
55
+ dataIndex: 'type',
56
+ key: 'type',
57
+ },
58
  ];
59
 
60
 
app/(home)/reports/page.tsx CHANGED
@@ -1,8 +1,34 @@
1
  'use client';
2
- import React from "react";
 
 
 
 
3
  const Reports = () => {
 
 
 
 
 
 
 
 
4
  return (
5
- <div>reports route</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  );
7
  }
8
 
 
1
  'use client';
2
+ import { incomeStatements } from "@/app/lib/endpoints";
3
+ import moment from "moment";
4
+ import { List } from "antd";
5
+ import React, { useEffect, useState } from "react";
6
+
7
  const Reports = () => {
8
+ const [statements, setStatements] = useState([]);
9
+ useEffect(() => {
10
+ (async () => {
11
+ const data = await fetch(incomeStatements)
12
+ const statements = await data.json();
13
+ setStatements(statements);
14
+ })();
15
+ }, []);
16
  return (
17
+ <div style={{ padding: 24 }}>
18
+ <h1>Statements</h1>
19
+ <List
20
+ itemLayout="horizontal"
21
+ dataSource={statements}
22
+ renderItem={(item: any) => (
23
+ <List.Item>
24
+ <List.Item.Meta
25
+ title={<a href="#">{`${moment(item.date_from).format('MM-DD-YYYY')} until ${moment(item.date_to).format('MM-DD-YYYY')}`}</a>}
26
+ // description="This is the description"
27
+ />
28
+ </List.Item>
29
+ )}
30
+ />
31
+ </div>
32
  );
33
  }
34
 
app/lib/endpoints/index.ts CHANGED
@@ -2,4 +2,6 @@ const baseUrl = process.env.NEXT_PUBLIC_BASE_URL;
2
  const url = `${baseUrl}/api/v1`
3
 
4
  export const transactionsEndpoint = `${url}/transactions/1`;
5
- export const fielUploadEndpoint = `${url}/file_upload`;
 
 
 
2
  const url = `${baseUrl}/api/v1`
3
 
4
  export const transactionsEndpoint = `${url}/transactions/1`;
5
+ export const fielUploadEndpoint = `${url}/file_upload`;
6
+ export const incomeStatements = `${url}/income_statement/1`;
7
+ export const statementEndpoint = `${url}/statement`;
package-lock.json CHANGED
@@ -22,6 +22,7 @@
22
  "dotenv": "^16.3.1",
23
  "llamaindex": "0.3.13",
24
  "lucide-react": "^0.294.0",
 
25
  "next": "^14.0.3",
26
  "pdf2json": "3.0.5",
27
  "react": "^18.2.0",
@@ -9124,6 +9125,14 @@
9124
  "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz",
9125
  "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A=="
9126
  },
 
 
 
 
 
 
 
 
9127
  "node_modules/mongodb": {
9128
  "version": "6.6.2",
9129
  "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.6.2.tgz",
 
22
  "dotenv": "^16.3.1",
23
  "llamaindex": "0.3.13",
24
  "lucide-react": "^0.294.0",
25
+ "moment": "^2.30.1",
26
  "next": "^14.0.3",
27
  "pdf2json": "3.0.5",
28
  "react": "^18.2.0",
 
9125
  "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz",
9126
  "integrity": "sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A=="
9127
  },
9128
+ "node_modules/moment": {
9129
+ "version": "2.30.1",
9130
+ "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz",
9131
+ "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==",
9132
+ "engines": {
9133
+ "node": "*"
9134
+ }
9135
+ },
9136
  "node_modules/mongodb": {
9137
  "version": "6.6.2",
9138
  "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.6.2.tgz",
package.json CHANGED
@@ -25,6 +25,7 @@
25
  "dotenv": "^16.3.1",
26
  "llamaindex": "0.3.13",
27
  "lucide-react": "^0.294.0",
 
28
  "next": "^14.0.3",
29
  "pdf2json": "3.0.5",
30
  "react": "^18.2.0",
 
25
  "dotenv": "^16.3.1",
26
  "llamaindex": "0.3.13",
27
  "lucide-react": "^0.294.0",
28
+ "moment": "^2.30.1",
29
  "next": "^14.0.3",
30
  "pdf2json": "3.0.5",
31
  "react": "^18.2.0",