@@ -4,39 +4,28 @@ import React, { PropsWithChildren } from "react";
44import styles from "./RetroWindow.module.scss" ;
55
66/**
7- * Retro window shell: title bar, optional menu bar, main body, optional footer row.
7+ * Retro window shell: title bar, optional menu bar, optional toolbar,
8+ * main body, and optional footer row.
89 *
910 * `children` (from `PropsWithChildren`) is the main body content.
1011 */
1112export interface RetroWindowProps extends PropsWithChildren {
1213 /** When true, shows the “File Edit Insert” menu bar (visual only). */
13- isEdit ?: boolean ;
14+ showEditBar ?: boolean ;
1415 /** Text shown in the blue gradient title bar. */
1516 title : string ;
16- /**
17- * When true, wraps the main `children` in the bordered panel; the child sets its
18- * own background (e.g. white). When false, children sit on the default gray (#E2E2E0).
19- */
20- useChildBackground ?: boolean ;
21- /**
22- * Optional row below the main child (e.g. toolbar), on the window gray unless
23- * `useChild2Background` is true.
24- */
25- secondChild ?: React . ReactNode ;
26- /**
27- * When true with `secondChild`, applies the same bordered panel treatment as
28- * `useChildBackground` for the second row (rare; e.g. home background picker).
29- */
30- useChild2Background ?: boolean ;
17+ /** Optional row above the main content, e.g. tabs, filters, or tools. */
18+ toolbar ?: React . ReactNode ;
19+ /** Optional row below the main content, e.g. status text or actions. */
20+ footer ?: React . ReactNode ;
3121}
3222
3323const RetroWindow = ( {
3424 title,
3525 children,
36- isEdit = false ,
37- useChildBackground = false ,
38- secondChild,
39- useChild2Background = false ,
26+ showEditBar = false ,
27+ toolbar,
28+ footer,
4029} : RetroWindowProps ) => {
4130 return (
4231 < div className = { styles . root } >
@@ -67,8 +56,8 @@ const RetroWindow = ({
6756 </ div >
6857 </ div >
6958
70- < div className = { clsx ( styles . body , isEdit && styles . bodyWithMenu ) } >
71- { isEdit && (
59+ < div className = { clsx ( styles . body , showEditBar && styles . bodyWithMenu ) } >
60+ { showEditBar && (
7261 < nav className = { styles . editMenu } aria-hidden >
7362 < span >
7463 < span className = { styles . menuKey } > F</ span > ile
@@ -81,22 +70,15 @@ const RetroWindow = ({
8170 </ span >
8271 </ nav >
8372 ) }
84- < div
85- className = { clsx (
86- useChildBackground ? styles . childPanel : styles . childContent ,
87- ) }
88- >
89- { children }
90- </ div >
9173
92- { secondChild != null && (
93- < div
94- className = { clsx (
95- useChild2Background ? styles . childPanel : styles . secondChild ,
96- ) }
97- >
98- { secondChild }
99- </ div >
74+ { toolbar != null && (
75+ < div className = { styles . toolbar } > { toolbar } </ div >
76+ ) }
77+
78+ < div className = { styles . content } > { children } </ div >
79+
80+ { footer != null && (
81+ < div className = { styles . footer } > { footer } < /div >
10082 ) }
10183 </ div >
10284 </ div >
0 commit comments