File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
apps/frontend/src/widgets/TopNavView/ui Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -3,18 +3,32 @@ import { Menu, X } from "lucide-react";
33import { Divider } from "@/shared/ui" ;
44import { WorkspaceNav } from "@/features/pageSidebar/ui" ;
55import { UserInfoView } from "@/widgets/UserInfoView/ui" ;
6+ import { useUserWorkspace } from "@/features/workspace/model/useWorkspace" ;
7+ import { useWorkspace } from "@/shared/lib/useWorkspace" ;
68
79interface TopNavProps {
810 onExpand : ( ) => void ;
911 isExpanded : boolean ;
1012}
1113export function TopNavView ( { onExpand, isExpanded } : TopNavProps ) {
14+ const workspace = useWorkspace ( ) ;
15+ const { data } = useUserWorkspace ( ) ;
16+
17+ const getWorkspaceTitle = ( ) => {
18+ if ( ! workspace ) return "공용 워크스페이스" ;
19+
20+ return (
21+ data ?. workspaces . find ( ( w ) => w . workspaceId === workspace ) ?. title ??
22+ "로딩 중..."
23+ ) ;
24+ } ;
25+
1226 return (
1327 < div className = "flex w-full flex-row items-center justify-between" >
1428 < div className = "flex flex-row items-center gap-2" >
1529 < UserInfoView />
1630 < Divider direction = "vertical" className = "h-3" />
17- < WorkspaceNav workspaceTitle = "프로젝트 Web15" />
31+ < WorkspaceNav workspaceTitle = { getWorkspaceTitle ( ) } />
1832 </ div >
1933 < div className = "flex h-7 w-7 items-center justify-center" >
2034 < button onClick = { onExpand } >
You can’t perform that action at this time.
0 commit comments