-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b776dac
commit ab21cf6
Showing
6 changed files
with
178 additions
and
41 deletions.
There are no files selected for viewing
6 changes: 4 additions & 2 deletions
6
automonous_agent_frontend/src/app/components/OverViewCard.tsx
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
83 changes: 83 additions & 0 deletions
83
automonous_agent_frontend/src/app/components/OverViewGraphCard.tsx
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,83 @@ | ||
import { ArrowDown, ArrowUp, FileText } from 'lucide-react'; | ||
import { FileCog } from 'lucide-react'; | ||
|
||
import { Card } from '@app/components/atoms/Card'; | ||
import CustomLineChart, { | ||
ILineChartData | ||
} from '@app/components/molecules/chart/CustomLineChart'; | ||
|
||
import OverViewCard from './OverViewCard'; | ||
import { cn } from '@app/components/lib/utils'; | ||
|
||
export interface IOverViewTemplatesCard { | ||
title: string; | ||
totalValue : number | ||
changeRate : number | ||
graphData?: ILineChartData[]; | ||
theme? : string | ||
} | ||
|
||
export const demoGraphData: ILineChartData[] = [ | ||
{ | ||
name: 'a', | ||
amt: 0 | ||
}, | ||
{ | ||
name: 'b', | ||
amt: 5 | ||
}, | ||
{ | ||
name : 'c', | ||
amt : 12, | ||
}, | ||
{ | ||
name : 'd', | ||
amt : 11, | ||
}, | ||
{ | ||
name: 'e', | ||
amt: 7 | ||
} | ||
]; | ||
|
||
export default function OverViewGraphCard({ | ||
title, | ||
totalValue, | ||
changeRate, | ||
graphData = demoGraphData, | ||
theme = "Primary" | ||
}: IOverViewTemplatesCard) { | ||
return ( | ||
<OverViewCard title={title} value={totalValue}> | ||
<div className="flex w-full items-center gap-x-12 4xl:gap-x-12 relative"> | ||
<div className="flex items-center gap-x-1"> | ||
<div className={cn("rounded-full p-1" , theme === "Primary" ? "bg-brand-Orange-100" : "bg-brand-Green-100")}> | ||
{changeRate > 0 ? ( | ||
<ArrowUp stroke={cn(theme === "Primary" ? "#FF660F" : "#007900" )} size={20} /> | ||
) : ( | ||
<ArrowDown stroke={cn(theme === "Primary" ? "#FF660F" : "#007900" )} size={20} /> | ||
)} | ||
</div> | ||
<span className={cn("h4" , theme === "Primary" ? "text-brand-Orange-200" : "text-brand-Green-200")}> | ||
{changeRate} % | ||
</span> | ||
</div> | ||
<div className="absolute flex h-28 w-28 items-center gap-x-1 bottom-0 right-0"> | ||
<CustomLineChart | ||
chartData={graphData} | ||
renderLines={false} | ||
renderXaxis={false} | ||
renderYaxis={false} | ||
renderDot={false} | ||
renderToolTip={false} | ||
strokeColor= {theme === "Primary" ? "#FF660F" : "#5F00D7"} | ||
strokeWidth="2" | ||
smoothStroke={false} | ||
fillGradiant={false} | ||
strokeCoverColor= {theme === "Primary" ? "#FFECD4" : "#F8E8F8"} | ||
/> | ||
</div> | ||
</div> | ||
</OverViewCard> | ||
); | ||
} |
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
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