add more example utils to dashboard
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
import { RecentActivity } from "@/components/dashboard/activity";
|
||||
import { AppOverview } from "@/components/dashboard/appOverview";
|
||||
import { NetworkOverview } from "@/components/dashboard/NetworkOverview";
|
||||
import { Notifications } from "@/components/dashboard/notifications";
|
||||
import { QuickActions } from "@/components/quickActions";
|
||||
import { QuickActions } from "@/components/dashboard/quickActions";
|
||||
import { TaskQueue } from "@/components/dashboard/taskQueue";
|
||||
import { tw } from "@/utils/tailwind";
|
||||
|
||||
interface DashboardCardProps {
|
||||
children?: React.ReactNode;
|
||||
rowSpan?: number;
|
||||
sx?: string;
|
||||
}
|
||||
const DashboardCard = (props: DashboardCardProps) => {
|
||||
const { children } = props;
|
||||
const { children, rowSpan = 1, sx = "" } = props;
|
||||
return (
|
||||
<div className="col-span-full row-span-1 border border-dashed border-slate-400 lg:col-span-1">
|
||||
<div className={tw`col-span-full row-span-${rowSpan} xl:col-span-1 ${sx}`}>
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
@@ -21,9 +26,7 @@ interface DashboardPanelProps {
|
||||
const DashboardPanel = (props: DashboardPanelProps) => {
|
||||
const { children } = props;
|
||||
return (
|
||||
<div className="col-span-full row-span-1 shrink-0 border border-dashed border-slate-400 lg:col-span-2">
|
||||
{children}
|
||||
</div>
|
||||
<div className="col-span-full row-span-1 xl:col-span-2">{children}</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -36,10 +39,7 @@ const SplitDashboardCard = (props: SplitDashboardCardProps) => {
|
||||
<div className="col-span-full row-span-1 lg:col-span-1">
|
||||
<div className="grid h-full grid-cols-1 gap-4">
|
||||
{children?.map((row, idx) => (
|
||||
<div
|
||||
key={idx}
|
||||
className="col-span-full row-span-1 border border-dashed border-slate-400"
|
||||
>
|
||||
<div key={idx} className="col-span-full row-span-1 ">
|
||||
{row}
|
||||
</div>
|
||||
))}
|
||||
@@ -51,19 +51,25 @@ const SplitDashboardCard = (props: SplitDashboardCardProps) => {
|
||||
export default function Dashboard() {
|
||||
return (
|
||||
<div className="flex h-screen w-full">
|
||||
<div className="grid w-full auto-rows-min grid-cols-3 gap-4">
|
||||
<DashboardCard>
|
||||
<div className="grid w-full auto-cols-min grid-flow-row auto-rows-min grid-cols-1 grid-rows-none gap-4 xl:grid-cols-2 2xl:grid-cols-3 ">
|
||||
<DashboardCard rowSpan={2}>
|
||||
<NetworkOverview />
|
||||
</DashboardCard>
|
||||
<DashboardCard>
|
||||
<DashboardCard rowSpan={2}>
|
||||
<RecentActivity />
|
||||
</DashboardCard>
|
||||
<SplitDashboardCard>
|
||||
<DashboardCard>
|
||||
<Notifications />
|
||||
</DashboardCard>
|
||||
<DashboardCard>
|
||||
<QuickActions />
|
||||
</SplitDashboardCard>
|
||||
<DashboardPanel>Panel</DashboardPanel>
|
||||
<DashboardCard>Side Bar (misc)</DashboardCard>
|
||||
</DashboardCard>
|
||||
<DashboardPanel>
|
||||
<AppOverview />
|
||||
</DashboardPanel>
|
||||
<DashboardCard sx={tw`xl:col-span-full 2xl:col-span-1`}>
|
||||
<TaskQueue />
|
||||
</DashboardCard>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user