feat: implement session creation flow

Refactor `CreateSessionDialog` to be controlled by its parent instead
of using an internal `open` prop. Lift the state up to `JournalPanel`
and pass the creation callback through `JournalHeader` to
`SessionDropdown`.
This commit is contained in:
2026-07-08 00:39:29 +08:00
parent 376dde44b5
commit c13f66153a
4 changed files with 67 additions and 58 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ import { SessionDropdown } from "./SessionDropdown";
interface JournalHeaderProps {
onClose: () => void;
onCreateSession: () => void;
}
export const JournalHeader: Component<JournalHeaderProps> = (props) => {
@@ -51,7 +52,7 @@ export const JournalHeader: Component<JournalHeaderProps> = (props) => {
</p>
{/* Clickable subtitle — session dropdown (GM only) */}
<Show when={stream.myRole === "gm"}>
<SessionDropdown />
<SessionDropdown onCreate={props.onCreateSession} />
</Show>
</div>
</Show>