File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/components/ui/dashboard Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -4,14 +4,22 @@ import { useState } from "react";
44import { AddCoachingSessionDialog } from "./add-coaching-session-dialog" ;
55import { AddCoachingSessionButton } from "./add-coaching-session-button" ;
66import { AddMemberButton } from "./add-member-button" ;
7+ import { useRouter } from "next/navigation" ;
8+ import { useOrganizationStateStore } from "@/lib/providers/organization-state-store-provider" ;
79
810export default function CreateEntity ( ) {
11+ const router = useRouter ( ) ;
912 const [ open , setOpen ] = useState ( false ) ;
13+ const { currentOrganizationId } = useOrganizationStateStore ( ( state ) => state ) ;
1014
1115 const onCoachingSessionAdded = ( ) => {
1216 setOpen ( false ) ;
1317 } ;
1418
19+ const onMemberButtonClicked = ( ) => {
20+ router . push ( `/organizations/${ currentOrganizationId } /members` ) ;
21+ } ;
22+
1523 return (
1624 < div className = "space-y-4" >
1725 < h2 className = "text-2xl font-bold tracking-tight" > Create</ h2 >
@@ -23,7 +31,7 @@ export default function CreateEntity() {
2331 dialogTrigger = { < AddCoachingSessionButton /> }
2432 />
2533
26- < AddMemberButton />
34+ < AddMemberButton onClick = { onMemberButtonClicked } />
2735 </ div >
2836 </ div >
2937 ) ;
You can’t perform that action at this time.
0 commit comments