-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop-prateek-pareek' of https://github.com/prateek-p…
…areek/frontend-web-ad into prateek-pareek-develop-prateek-pareek
- Loading branch information
Showing
23 changed files
with
2,620 additions
and
429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
"use client"; | ||
|
||
import React from "react"; | ||
import DashBoard from "@/components/ui/dashboard/index"; | ||
import DashboardChart from "@/components/ui/dashboard/charts"; | ||
import Layout from "@/components/ui/layout/index"; | ||
import Dashboard from "@/components/ui/dashboard/dashboard"; | ||
|
||
export default function Page() { | ||
return ( | ||
<React.Fragment> | ||
<DashBoard> | ||
<DashboardChart /> | ||
</DashBoard> | ||
</React.Fragment> | ||
<Layout> | ||
<Dashboard /> | ||
</Layout> | ||
); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
"use client"; | ||
|
||
import React from "react"; | ||
import DashBoard from "@/components/ui/dashboard/index"; | ||
import DashboardChart from "@/components/ui/dashboard/charts"; | ||
import Layout from "@/components/ui/layout/index"; | ||
import Dashboard from "@/components/ui/dashboard/dashboard"; | ||
|
||
export default function Page() { | ||
return ( | ||
<React.Fragment> | ||
<DashBoard> | ||
<DashboardChart /> | ||
</DashBoard> | ||
</React.Fragment> | ||
<Layout> | ||
<Dashboard /> | ||
</Layout> | ||
); | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import '../(root)/globals.css'; | ||
export const metadata = { | ||
title: 'Next.js', | ||
description: 'Generated by Next.js', | ||
} | ||
import { Analytics } from '@vercel/analytics/react'; | ||
import { SessionProvider } from 'next-auth/react'; | ||
import { SpeedInsights } from "@vercel/speed-insights/next" | ||
import { NextUIProvider } from '@nextui-org/react'; | ||
// import { ThemeProvider as NextThemesProvider } from "next-themes"; | ||
import { NotificationProvider } from '@/components/ui/NotificationContext'; | ||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
|
||
<html lang="en" > | ||
<body className="static h-full bg-gray-50"> | ||
<SessionProvider> | ||
<NextUIProvider> | ||
{/* <NextThemesProvider attribute="class" defaultTheme='light'> */} | ||
<main className="text-foreground bg-background"> | ||
<NotificationProvider> | ||
{children} | ||
</NotificationProvider> | ||
</main> | ||
<Analytics /> | ||
<SpeedInsights /> | ||
{/* </NextThemesProvider> */} | ||
</NextUIProvider> | ||
</SessionProvider> | ||
</body> | ||
</html> | ||
|
||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"use client"; | ||
import ScheduleAutomationPage from "@/components/ui/report/automation/automation" | ||
import React from "react"; | ||
import Layout from "@/components/ui/layout/index"; | ||
|
||
const Page: React.FC<any> = () => { | ||
return ( | ||
<Layout> | ||
<ScheduleAutomationPage/> | ||
</Layout> | ||
); | ||
}; | ||
|
||
|
||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"use client"; | ||
|
||
import React from "react"; | ||
import Layout from "@/components/ui/layout/index"; | ||
import ImportPage from "@/components/ui/report/import/import"; | ||
|
||
const Page: React.FC<any> = () => { | ||
return ( | ||
<Layout> | ||
<ImportPage/> | ||
</Layout> | ||
); | ||
}; | ||
|
||
|
||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import '../globals.css'; | ||
export const metadata = { | ||
title: 'Next.js', | ||
description: 'Generated by Next.js', | ||
} | ||
import { Analytics } from '@vercel/analytics/react'; | ||
import { SessionProvider } from 'next-auth/react'; | ||
import { SpeedInsights } from "@vercel/speed-insights/next" | ||
import { NextUIProvider } from '@nextui-org/react'; | ||
// import { ThemeProvider as NextThemesProvider } from "next-themes"; | ||
import { NotificationProvider } from '@/components/ui/NotificationContext'; | ||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
|
||
<html lang="en" > | ||
<body className="static h-full bg-gray-50"> | ||
<SessionProvider> | ||
<NextUIProvider> | ||
{/* <NextThemesProvider attribute="class" defaultTheme='light'> */} | ||
<main className="text-foreground bg-background"> | ||
<NotificationProvider> | ||
{children} | ||
</NotificationProvider> | ||
</main> | ||
<Analytics /> | ||
<SpeedInsights /> | ||
{/* </NextThemesProvider> */} | ||
</NextUIProvider> | ||
</SessionProvider> | ||
</body> | ||
</html> | ||
|
||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"use client"; | ||
|
||
import React from "react"; | ||
import Layout from "@/components/ui/layout/index"; | ||
import Report from "@/components/ui/report/report"; | ||
|
||
const Page: React.FC<any> = () => { | ||
return ( | ||
<Layout> | ||
<Report/> | ||
</Layout> | ||
); | ||
}; | ||
|
||
|
||
|
||
export default Page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
'use client'; | ||
|
||
import React, { createContext, useContext, useState, ReactNode, useEffect } from 'react'; | ||
import { toast, ToastContainer } from 'react-toastify'; | ||
import 'react-toastify/dist/ReactToastify.css'; | ||
import Cookies from 'js-cookie'; | ||
|
||
interface NotificationContextProps { | ||
notify: (message: string) => void; | ||
} | ||
|
||
const NotificationContext = createContext<NotificationContextProps | undefined>(undefined); | ||
|
||
export const useNotification = () => { | ||
const context = useContext(NotificationContext); | ||
if (!context) { | ||
throw new Error('useNotification must be used within a NotificationProvider'); | ||
} | ||
return context; | ||
}; | ||
|
||
export function NotificationProvider({ children }: { children: ReactNode }) { | ||
const [message, setMessage] = useState<string | null>(null); | ||
|
||
const notify = (message: string) => { | ||
setMessage(message); | ||
Cookies.set('notification', message); | ||
}; | ||
|
||
useEffect(() => { | ||
const message = Cookies.get('notification'); | ||
if (message) { | ||
toast.success(message); | ||
Cookies.remove('notification'); | ||
} | ||
}, []); | ||
|
||
return ( | ||
<NotificationContext.Provider value={{ notify }}> | ||
{children} | ||
<ToastContainer /> | ||
</NotificationContext.Provider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
import { Card, DonutChart, List, ListItem } from '@tremor/react'; | ||
|
||
const currencyFormatter = (number: any) => { | ||
return number | ||
}; | ||
function classNames(...classes: any) { return classes.filter(Boolean).join(' '); } | ||
|
||
export default function Example(props: any) { | ||
return ( | ||
<> | ||
<Card className="sm:mx-auto sm:max-w-lg"> | ||
<h3 className="text-tremor-default font-medium text-tremor-content-strong dark:text-dark-tremor-content-strong"> | ||
{props.title} | ||
</h3> | ||
<DonutChart | ||
className="mt-8" | ||
data={props?.data} | ||
category="total" | ||
index="name" | ||
variant="pie" | ||
valueFormatter={currencyFormatter} | ||
showTooltip={true} | ||
showLabel={true} | ||
/> | ||
<p className="mt-8 flex items-center justify-between text-tremor-label text-tremor-content dark:text-dark-tremor-content"> | ||
<span>Category</span> | ||
<span>Total/Share</span> | ||
</p> | ||
<List className="mt-2"> | ||
{props.data.map((item: any) => ( | ||
<ListItem key={item.name} className="space-x-6"> | ||
<div className="flex items-center space-x-2.5 truncate"> | ||
<span | ||
className={classNames(item.color, 'h-2.5 w-2.5 shrink-0 rounded-sm',)} | ||
aria-hidden={true} | ||
/> | ||
<span className="truncate dark:text-dark-tremor-content-emphasis"> | ||
{item.name} | ||
{(item?.amount)?.toFixed(2)} | ||
</span> | ||
</div> | ||
<div className="flex items-center space-x-2"> | ||
<span className="rounded-tremor-small bg-tremor-background-subtle px-1.5 py-0.5 text-tremor-label font-medium tabular-nums text-tremor-content-emphasis dark:bg-dark-tremor-background-subtle dark:text-dark-tremor-content-emphasis"> | ||
{(item?.total)?.toFixed(2)}/{item.share} | ||
</span> | ||
</div> | ||
</ListItem> | ||
))} | ||
</List> | ||
</Card> | ||
</> | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.