Skip to content

Commit e3ef1f5

Browse files
committed
merge dashboard-content and dashboard-container
1 parent 14ddebb commit e3ef1f5

File tree

2 files changed

+21
-35
lines changed

2 files changed

+21
-35
lines changed

src/app/dashboard/dashboard-content.tsx renamed to src/app/dashboard/dashboard-container.tsx

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,7 @@ import AddEntities from "@/components/ui/dashboard/add-entities";
88
import { CoachingSessionDialog } from "@/components/ui/dashboard/coaching-session-dialog";
99
import type { CoachingSession } from "@/types/coaching-session";
1010

11-
function DashboardContainer({
12-
className,
13-
...props
14-
}: React.HTMLAttributes<HTMLDivElement>) {
15-
return (
16-
<div
17-
className={cn(
18-
// Base styles
19-
"p-4",
20-
// Mobile: stack vertically
21-
"flex flex-col gap-6",
22-
// Never grow wider than the site-header
23-
"max-w-screen-2xl",
24-
// Ensure full width for children
25-
"[&>*]:w-full",
26-
className
27-
)}
28-
{...props}
29-
/>
30-
);
31-
}
32-
33-
export function DashboardContent() {
11+
export function DashboardContainer() {
3412
const [dialogOpen, setDialogOpen] = useState(false);
3513
const [sessionToEdit, setSessionToEdit] = useState<
3614
CoachingSession | undefined
@@ -47,20 +25,28 @@ export function DashboardContent() {
4725
};
4826

4927
return (
50-
<>
51-
<DashboardContainer>
52-
<AddEntities
53-
className="mb-8"
54-
onCreateSession={() => handleOpenDialog()}
55-
/>
56-
<CoachingSessionList onUpdateSession={handleOpenDialog} />
57-
</DashboardContainer>
58-
28+
<div
29+
className={cn(
30+
// Base styles
31+
"p-4",
32+
// Mobile: stack vertically
33+
"flex flex-col gap-6",
34+
// Never grow wider than the site-header
35+
"max-w-screen-2xl",
36+
// Ensure full width for children
37+
"[&>*]:w-full"
38+
)}
39+
>
40+
<AddEntities
41+
className="mb-8"
42+
onCreateSession={() => handleOpenDialog()}
43+
/>
44+
<CoachingSessionList onUpdateSession={handleOpenDialog} />
5945
<CoachingSessionDialog
6046
open={dialogOpen}
6147
onOpenChange={handleCloseDialog}
6248
coachingSessionToEdit={sessionToEdit}
6349
/>
64-
</>
50+
</div>
6551
);
6652
}

src/app/dashboard/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { Metadata } from "next";
2-
import { DashboardContent } from "./dashboard-content";
2+
import { DashboardContainer } from "./dashboard-container";
33

44
export const metadata: Metadata = {
55
title: "Dashboard",
66
description: "Coaching dashboard",
77
};
88

99
export default function DashboardPage() {
10-
return <DashboardContent />;
10+
return <DashboardContainer />;
1111
}

0 commit comments

Comments
 (0)