@locusai/web 0.1.7 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/next.config.js +15 -2
- package/package.json +26 -3
- package/src/app/(auth)/invite/page.tsx +109 -0
- package/src/app/(auth)/layout.tsx +19 -0
- package/src/app/(auth)/login/page.tsx +65 -0
- package/src/app/(auth)/onboarding/workspace/page.tsx +46 -0
- package/src/app/(auth)/register/page.tsx +165 -0
- package/src/app/(dashboard)/activity/page.tsx +7 -0
- package/src/app/(dashboard)/backlog/page.tsx +195 -0
- package/src/app/(dashboard)/board/page.tsx +141 -0
- package/src/app/(dashboard)/layout.tsx +32 -0
- package/src/app/(dashboard)/page.tsx +14 -0
- package/src/app/(dashboard)/settings/page.tsx +161 -0
- package/src/app/(dashboard)/settings/team/page.tsx +75 -0
- package/src/app/globals.css +259 -0
- package/src/app/layout.tsx +10 -20
- package/src/app/providers.tsx +26 -3
- package/src/components/AuthLayoutUI.tsx +53 -0
- package/src/components/BoardFilter.tsx +75 -74
- package/src/components/CreateModal/CreateModal.tsx +142 -0
- package/src/components/CreateModal/index.ts +1 -0
- package/src/components/Editor.tsx +279 -0
- package/src/components/Header.tsx +99 -12
- package/src/components/PageLayout.tsx +69 -0
- package/src/components/PropertyItem.tsx +55 -9
- package/src/components/Sidebar.tsx +280 -36
- package/src/components/SprintCreateModal.tsx +84 -0
- package/src/components/TaskCard.tsx +196 -78
- package/src/components/TaskCreateModal.tsx +181 -178
- package/src/components/TaskPanel.tsx +140 -692
- package/src/components/WorkspaceCreateModal.tsx +97 -0
- package/src/components/WorkspaceProtected.tsx +91 -0
- package/src/components/auth/InviteSteps.tsx +220 -0
- package/src/components/auth/LoginSteps.tsx +86 -0
- package/src/components/auth/RegisterSteps.tsx +371 -0
- package/src/components/auth/index.ts +3 -0
- package/src/components/backlog/BacklogList.tsx +92 -0
- package/src/components/backlog/BacklogSection.tsx +137 -0
- package/src/components/backlog/CompletedSprintItem.tsx +95 -0
- package/src/components/backlog/CompletedSprintsSection.tsx +77 -0
- package/src/components/backlog/SprintSection.tsx +155 -0
- package/src/components/backlog/constants.ts +26 -0
- package/src/components/board/BoardColumn.tsx +97 -0
- package/src/components/board/BoardContent.tsx +84 -0
- package/src/components/board/BoardEmptyState.tsx +82 -0
- package/src/components/board/BoardHeader.tsx +47 -0
- package/src/components/board/SprintMindmap.tsx +65 -0
- package/src/components/board/constants.ts +40 -0
- package/src/components/board/index.ts +5 -0
- package/src/components/common/ErrorState.tsx +124 -0
- package/src/components/common/LoadingState.tsx +83 -0
- package/src/components/common/index.ts +40 -0
- package/src/components/dashboard/ActivityFeed.tsx +77 -0
- package/src/components/dashboard/ActivityItem.tsx +207 -0
- package/src/components/dashboard/QuickActions.tsx +50 -0
- package/src/components/dashboard/StatCard.tsx +79 -0
- package/src/components/dnd/index.tsx +51 -0
- package/src/components/docs/DocsEditorArea.tsx +87 -0
- package/src/components/docs/DocsHeaderActions.tsx +121 -0
- package/src/components/docs/DocsSidebar.tsx +351 -0
- package/src/components/index.ts +7 -0
- package/src/components/onboarding/StepProgress.tsx +21 -0
- package/src/components/onboarding/index.ts +1 -0
- package/src/components/settings/ApiKeyConfirmationModal.tsx +81 -0
- package/src/components/settings/ApiKeyCreatedModal.tsx +96 -0
- package/src/components/settings/ApiKeysList.tsx +143 -0
- package/src/components/settings/ApiKeysSettings.tsx +144 -0
- package/src/components/settings/InviteMemberModal.tsx +106 -0
- package/src/components/settings/ProjectSetupGuide.tsx +147 -0
- package/src/components/settings/SettingItem.tsx +32 -0
- package/src/components/settings/SettingSection.tsx +50 -0
- package/src/components/settings/TeamInvitationsList.tsx +90 -0
- package/src/components/settings/TeamMembersList.tsx +95 -0
- package/src/components/settings/index.ts +8 -0
- package/src/components/task-panel/TaskActivity.tsx +127 -0
- package/src/components/task-panel/TaskChecklist.tsx +142 -0
- package/src/components/task-panel/TaskDescription.tsx +201 -0
- package/src/components/task-panel/TaskDocs.tsx +137 -0
- package/src/components/task-panel/TaskHeader.tsx +125 -0
- package/src/components/task-panel/TaskProperties.tsx +111 -0
- package/src/components/task-panel/index.ts +12 -0
- package/src/components/typography/EmptyStateText.tsx +59 -0
- package/src/components/typography/MetadataText.tsx +65 -0
- package/src/components/typography/SecondaryText.tsx +60 -0
- package/src/components/typography/SectionLabel.tsx +60 -0
- package/src/components/typography/index.ts +14 -0
- package/src/components/typography-scales.tsx +218 -0
- package/src/components/ui/Avatar.tsx +123 -0
- package/src/components/ui/Badge.tsx +69 -2
- package/src/components/ui/Button.tsx +71 -30
- package/src/components/ui/Checkbox.tsx +34 -0
- package/src/components/ui/Dropdown.tsx +67 -1
- package/src/components/ui/EmptyState.tsx +129 -0
- package/src/components/ui/Input.tsx +53 -6
- package/src/components/ui/Modal.tsx +45 -12
- package/src/components/ui/OtpInput.tsx +148 -0
- package/src/components/ui/Skeleton.tsx +36 -0
- package/src/components/ui/Spinner.tsx +112 -0
- package/src/components/ui/Textarea.tsx +28 -3
- package/src/components/ui/Toast.tsx +99 -0
- package/src/components/ui/Toggle.tsx +63 -0
- package/src/components/ui/constants.ts +108 -0
- package/src/components/ui/index.ts +7 -0
- package/src/context/AuthContext.tsx +140 -0
- package/src/context/index.ts +1 -0
- package/src/hooks/backlog/index.ts +13 -0
- package/src/hooks/backlog/useBacklogActions.ts +144 -0
- package/src/hooks/backlog/useBacklogComposite.ts +73 -0
- package/src/hooks/backlog/useBacklogData.ts +74 -0
- package/src/hooks/backlog/useBacklogDragDrop.ts +118 -0
- package/src/hooks/backlog/useBacklogUI.ts +74 -0
- package/src/hooks/index.ts +22 -0
- package/src/hooks/task-panel/index.ts +13 -0
- package/src/hooks/task-panel/useTaskActions.ts +200 -0
- package/src/hooks/task-panel/useTaskComputedValues.ts +30 -0
- package/src/hooks/task-panel/useTaskData.ts +78 -0
- package/src/hooks/task-panel/useTaskPanelComposite.ts +161 -0
- package/src/hooks/task-panel/useTaskUIState.ts +80 -0
- package/src/hooks/useAuthLayoutLogic.ts +43 -0
- package/src/hooks/useAuthenticatedUser.ts +36 -0
- package/src/hooks/useAuthenticatedUserWithOrg.ts +41 -0
- package/src/hooks/useBacklog.ts +303 -0
- package/src/hooks/useBoard.ts +230 -0
- package/src/hooks/useDashboardLayout.ts +49 -0
- package/src/hooks/useDocs.ts +279 -0
- package/src/hooks/useDocsQuery.ts +99 -0
- package/src/hooks/useDocsSidebarState.ts +104 -0
- package/src/hooks/useFormState.ts +40 -0
- package/src/hooks/useGlobalKeydowns.ts +52 -0
- package/src/hooks/useInviteForm.ts +122 -0
- package/src/hooks/useLoginForm.ts +84 -0
- package/src/hooks/useMutationWithToast.ts +56 -0
- package/src/hooks/useOrganizationQuery.ts +55 -0
- package/src/hooks/useRegisterForm.ts +216 -0
- package/src/hooks/useSprintsQuery.ts +38 -0
- package/src/hooks/useTaskDescription.ts +102 -0
- package/src/hooks/useTaskPanel.ts +341 -0
- package/src/hooks/useTasksQuery.ts +39 -0
- package/src/hooks/useTeamManagement.ts +92 -0
- package/src/hooks/useWorkspaceCreateForm.ts +70 -0
- package/src/hooks/useWorkspaceId.ts +29 -0
- package/src/lib/api-client.ts +40 -23
- package/src/lib/config.ts +25 -0
- package/src/lib/constants.ts +83 -0
- package/src/lib/options.ts +96 -0
- package/src/lib/query-keys.ts +91 -0
- package/src/lib/typography.ts +103 -0
- package/src/lib/utils.ts +4 -0
- package/src/lib/validation.ts +192 -0
- package/src/services/index.ts +7 -3
- package/src/services/notifications.ts +80 -0
- package/src/utils/env.utils.ts +15 -0
- package/src/views/ActivityView.tsx +123 -0
- package/src/views/Dashboard.tsx +126 -0
- package/src/views/Docs.tsx +98 -612
- package/tsconfig.tsbuildinfo +1 -1
- package/.next/BUILD_ID +0 -1
- package/.next/app-build-manifest.json +0 -55
- package/.next/app-path-routes-manifest.json +0 -8
- package/.next/build-manifest.json +0 -33
- package/.next/cache/.previewinfo +0 -1
- package/.next/cache/.rscinfo +0 -1
- package/.next/cache/.tsbuildinfo +0 -1
- package/.next/cache/config.json +0 -7
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/diagnostics/build-diagnostics.json +0 -6
- package/.next/diagnostics/framework.json +0 -1
- package/.next/export-detail.json +0 -5
- package/.next/export-marker.json +0 -6
- package/.next/images-manifest.json +0 -57
- package/.next/next-minimal-server.js.nft.json +0 -1
- package/.next/next-server.js.nft.json +0 -1
- package/.next/package.json +0 -1
- package/.next/prerender-manifest.json +0 -137
- package/.next/react-loadable-manifest.json +0 -32
- package/.next/required-server-files.json +0 -324
- package/.next/routes-manifest.json +0 -77
- package/.next/server/app/_not-found/page.js +0 -2
- package/.next/server/app/_not-found/page.js.nft.json +0 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +0 -1
- package/.next/server/app/_not-found.html +0 -1
- package/.next/server/app/_not-found.meta +0 -8
- package/.next/server/app/_not-found.rsc +0 -21
- package/.next/server/app/backlog/page.js +0 -2
- package/.next/server/app/backlog/page.js.nft.json +0 -1
- package/.next/server/app/backlog/page_client-reference-manifest.js +0 -1
- package/.next/server/app/backlog.html +0 -1
- package/.next/server/app/backlog.meta +0 -7
- package/.next/server/app/backlog.rsc +0 -25
- package/.next/server/app/docs/page.js +0 -97
- package/.next/server/app/docs/page.js.nft.json +0 -1
- package/.next/server/app/docs/page_client-reference-manifest.js +0 -1
- package/.next/server/app/docs.html +0 -1
- package/.next/server/app/docs.meta +0 -7
- package/.next/server/app/docs.rsc +0 -26
- package/.next/server/app/favicon.ico/route.js +0 -1
- package/.next/server/app/favicon.ico/route.js.nft.json +0 -1
- package/.next/server/app/favicon.ico.body +0 -0
- package/.next/server/app/favicon.ico.meta +0 -1
- package/.next/server/app/index.html +0 -1
- package/.next/server/app/index.meta +0 -7
- package/.next/server/app/index.rsc +0 -25
- package/.next/server/app/page.js +0 -2
- package/.next/server/app/page.js.nft.json +0 -1
- package/.next/server/app/page_client-reference-manifest.js +0 -1
- package/.next/server/app/settings/page.js +0 -2
- package/.next/server/app/settings/page.js.nft.json +0 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +0 -1
- package/.next/server/app/settings.html +0 -1
- package/.next/server/app/settings.meta +0 -7
- package/.next/server/app/settings.rsc +0 -25
- package/.next/server/app-paths-manifest.json +0 -8
- package/.next/server/chunks/496.js +0 -6
- package/.next/server/chunks/585.js +0 -1
- package/.next/server/chunks/665.js +0 -1
- package/.next/server/chunks/699.js +0 -22
- package/.next/server/chunks/852.js +0 -7
- package/.next/server/functions-config-manifest.json +0 -4
- package/.next/server/interception-route-rewrite-manifest.js +0 -1
- package/.next/server/middleware-build-manifest.js +0 -1
- package/.next/server/middleware-manifest.json +0 -6
- package/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/.next/server/next-font-manifest.js +0 -1
- package/.next/server/next-font-manifest.json +0 -1
- package/.next/server/pages/404.html +0 -1
- package/.next/server/pages/500.html +0 -1
- package/.next/server/pages/_app.js +0 -1
- package/.next/server/pages/_app.js.nft.json +0 -1
- package/.next/server/pages/_document.js +0 -1
- package/.next/server/pages/_document.js.nft.json +0 -1
- package/.next/server/pages/_error.js +0 -19
- package/.next/server/pages/_error.js.nft.json +0 -1
- package/.next/server/pages-manifest.json +0 -6
- package/.next/server/server-reference-manifest.js +0 -1
- package/.next/server/server-reference-manifest.json +0 -1
- package/.next/server/webpack-runtime.js +0 -1
- package/.next/static/D0NXe04ZCLNDckV_quc8g/_buildManifest.js +0 -1
- package/.next/static/D0NXe04ZCLNDckV_quc8g/_ssgManifest.js +0 -1
- package/.next/static/chunks/138.b98511c56423f8bb.js +0 -1
- package/.next/static/chunks/146-34259952c594a3b0.js +0 -1
- package/.next/static/chunks/337-d3bb75304d130513.js +0 -1
- package/.next/static/chunks/477.1a6ecfe53375bd9c.js +0 -1
- package/.next/static/chunks/487-1808785ba665f784.js +0 -1
- package/.next/static/chunks/544.a9569941cc886e9d.js +0 -1
- package/.next/static/chunks/87c73c54-1f4741035a95c140.js +0 -1
- package/.next/static/chunks/902-d6926825a9fe8784.js +0 -1
- package/.next/static/chunks/955-c8f8f6235ae8f8c6.js +0 -1
- package/.next/static/chunks/996.e0a334e6ae90900e.js +0 -1
- package/.next/static/chunks/app/_not-found/page-44b1804abb44a34d.js +0 -1
- package/.next/static/chunks/app/backlog/page-dce1450769bfae8f.js +0 -1
- package/.next/static/chunks/app/docs/page-1efee819f25492cb.js +0 -1
- package/.next/static/chunks/app/layout-05f504c042b9f7ee.js +0 -1
- package/.next/static/chunks/app/page-3fd91aaaa4776ced.js +0 -1
- package/.next/static/chunks/app/settings/page-84e16c9638d657e4.js +0 -1
- package/.next/static/chunks/framework-152a1bc8c81c7458.js +0 -1
- package/.next/static/chunks/main-843ab130fc1be309.js +0 -1
- package/.next/static/chunks/main-app-123e879c5a937a00.js +0 -1
- package/.next/static/chunks/pages/_app-a050a8e6e4fb04cf.js +0 -1
- package/.next/static/chunks/pages/_error-3e422ffd891594de.js +0 -1
- package/.next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
- package/.next/static/chunks/webpack-99a10a055b5bb9c4.js +0 -1
- package/.next/static/css/13e8617b72f9d3aa.css +0 -1
- package/.next/static/css/8aea088cdc4338f0.css +0 -1
- package/.next/static/css/b301ab0424111664.css +0 -1
- package/.next/static/media/24c15609eaa28576-s.woff2 +0 -0
- package/.next/static/media/2c07349e02a7b712-s.woff2 +0 -0
- package/.next/static/media/456105d6ea6d39e0-s.woff2 +0 -0
- package/.next/static/media/47cbc4e2adbc5db9-s.p.woff2 +0 -0
- package/.next/static/media/4f77bef990aad698-s.woff2 +0 -0
- package/.next/static/media/627d916fd739a539-s.woff2 +0 -0
- package/.next/static/media/63b255f18bea0ca9-s.woff2 +0 -0
- package/.next/static/media/70bd82ac89b4fa42-s.woff2 +0 -0
- package/.next/static/media/84602850c8fd81c3-s.woff2 +0 -0
- package/.next/trace +0 -46
- package/.next/types/app/backlog/page.ts +0 -84
- package/.next/types/app/docs/page.ts +0 -84
- package/.next/types/app/layout.ts +0 -84
- package/.next/types/app/page.ts +0 -84
- package/.next/types/app/settings/page.ts +0 -84
- package/.next/types/cache-life.d.ts +0 -141
- package/.next/types/package.json +0 -1
- package/next-env.d.ts +0 -5
- package/out/404.html +0 -1
- package/out/_next/static/D0NXe04ZCLNDckV_quc8g/_buildManifest.js +0 -1
- package/out/_next/static/D0NXe04ZCLNDckV_quc8g/_ssgManifest.js +0 -1
- package/out/_next/static/chunks/138.b98511c56423f8bb.js +0 -1
- package/out/_next/static/chunks/146-34259952c594a3b0.js +0 -1
- package/out/_next/static/chunks/337-d3bb75304d130513.js +0 -1
- package/out/_next/static/chunks/477.1a6ecfe53375bd9c.js +0 -1
- package/out/_next/static/chunks/487-1808785ba665f784.js +0 -1
- package/out/_next/static/chunks/544.a9569941cc886e9d.js +0 -1
- package/out/_next/static/chunks/87c73c54-1f4741035a95c140.js +0 -1
- package/out/_next/static/chunks/902-d6926825a9fe8784.js +0 -1
- package/out/_next/static/chunks/955-c8f8f6235ae8f8c6.js +0 -1
- package/out/_next/static/chunks/996.e0a334e6ae90900e.js +0 -1
- package/out/_next/static/chunks/app/_not-found/page-44b1804abb44a34d.js +0 -1
- package/out/_next/static/chunks/app/backlog/page-dce1450769bfae8f.js +0 -1
- package/out/_next/static/chunks/app/docs/page-1efee819f25492cb.js +0 -1
- package/out/_next/static/chunks/app/layout-05f504c042b9f7ee.js +0 -1
- package/out/_next/static/chunks/app/page-3fd91aaaa4776ced.js +0 -1
- package/out/_next/static/chunks/app/settings/page-84e16c9638d657e4.js +0 -1
- package/out/_next/static/chunks/framework-152a1bc8c81c7458.js +0 -1
- package/out/_next/static/chunks/main-843ab130fc1be309.js +0 -1
- package/out/_next/static/chunks/main-app-123e879c5a937a00.js +0 -1
- package/out/_next/static/chunks/pages/_app-a050a8e6e4fb04cf.js +0 -1
- package/out/_next/static/chunks/pages/_error-3e422ffd891594de.js +0 -1
- package/out/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -1
- package/out/_next/static/chunks/webpack-99a10a055b5bb9c4.js +0 -1
- package/out/_next/static/css/13e8617b72f9d3aa.css +0 -1
- package/out/_next/static/css/8aea088cdc4338f0.css +0 -1
- package/out/_next/static/css/b301ab0424111664.css +0 -1
- package/out/_next/static/media/24c15609eaa28576-s.woff2 +0 -0
- package/out/_next/static/media/2c07349e02a7b712-s.woff2 +0 -0
- package/out/_next/static/media/456105d6ea6d39e0-s.woff2 +0 -0
- package/out/_next/static/media/47cbc4e2adbc5db9-s.p.woff2 +0 -0
- package/out/_next/static/media/4f77bef990aad698-s.woff2 +0 -0
- package/out/_next/static/media/627d916fd739a539-s.woff2 +0 -0
- package/out/_next/static/media/63b255f18bea0ca9-s.woff2 +0 -0
- package/out/_next/static/media/70bd82ac89b4fa42-s.woff2 +0 -0
- package/out/_next/static/media/84602850c8fd81c3-s.woff2 +0 -0
- package/out/backlog.html +0 -1
- package/out/backlog.txt +0 -25
- package/out/docs.html +0 -1
- package/out/docs.txt +0 -26
- package/out/favicon.ico +0 -0
- package/out/index.html +0 -1
- package/out/index.txt +0 -25
- package/out/logo.png +0 -0
- package/out/settings.html +0 -1
- package/out/settings.txt +0 -25
- package/src/app/backlog/page.tsx +0 -19
- package/src/app/page.tsx +0 -16
- package/src/app/settings/page.tsx +0 -194
- package/src/hooks/useTasks.ts +0 -119
- package/src/services/doc.service.ts +0 -27
- package/src/services/sprint.service.ts +0 -24
- package/src/services/task.service.ts +0 -75
- package/src/views/Backlog.tsx +0 -691
- package/src/views/Board.tsx +0 -306
- /package/src/app/{docs → (dashboard)/docs}/page.tsx +0 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { closestCenter, DndContext, DragOverlay } from "@dnd-kit/core";
|
|
4
|
+
import { AnimatePresence } from "framer-motion";
|
|
5
|
+
import { Layers, Plus } from "lucide-react";
|
|
6
|
+
import { BacklogList } from "@/components/backlog/BacklogList";
|
|
7
|
+
import { CompletedSprintsSection } from "@/components/backlog/CompletedSprintsSection";
|
|
8
|
+
import { SprintSection } from "@/components/backlog/SprintSection";
|
|
9
|
+
import { PageLayout } from "@/components/PageLayout";
|
|
10
|
+
import { SprintCreateModal } from "@/components/SprintCreateModal";
|
|
11
|
+
import { TaskCard } from "@/components/TaskCard";
|
|
12
|
+
import { TaskCreateModal } from "@/components/TaskCreateModal";
|
|
13
|
+
import { TaskPanel } from "@/components/TaskPanel";
|
|
14
|
+
import { Button, Spinner } from "@/components/ui";
|
|
15
|
+
import { useBacklog } from "@/hooks/useBacklog";
|
|
16
|
+
|
|
17
|
+
export default function BacklogPage() {
|
|
18
|
+
const {
|
|
19
|
+
tasks,
|
|
20
|
+
sprints,
|
|
21
|
+
backlogTasks,
|
|
22
|
+
activeSprint,
|
|
23
|
+
plannedSprints,
|
|
24
|
+
completedSprints,
|
|
25
|
+
getSprintTasks,
|
|
26
|
+
isLoading,
|
|
27
|
+
isTaskModalOpen,
|
|
28
|
+
setIsTaskModalOpen,
|
|
29
|
+
isSprintModalOpen,
|
|
30
|
+
setIsSprintModalOpen,
|
|
31
|
+
selectedTaskId,
|
|
32
|
+
setSelectedTaskId,
|
|
33
|
+
activeTask,
|
|
34
|
+
expandedSections,
|
|
35
|
+
isSubmitting,
|
|
36
|
+
sensors,
|
|
37
|
+
toggleSection,
|
|
38
|
+
handleDragStart,
|
|
39
|
+
handleDragEnd,
|
|
40
|
+
handleCreateSprint,
|
|
41
|
+
handleStartSprint,
|
|
42
|
+
handleCompleteSprint,
|
|
43
|
+
handleDeleteTask,
|
|
44
|
+
refetchTasks,
|
|
45
|
+
} = useBacklog();
|
|
46
|
+
|
|
47
|
+
if (isLoading) {
|
|
48
|
+
return (
|
|
49
|
+
<div className="flex items-center justify-center h-full">
|
|
50
|
+
<Spinner size="lg" />
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const headerActions = (
|
|
56
|
+
<div className="flex items-center gap-3">
|
|
57
|
+
<Button
|
|
58
|
+
variant="outline"
|
|
59
|
+
onClick={() => setIsSprintModalOpen(true)}
|
|
60
|
+
className="h-9 border-border/50"
|
|
61
|
+
>
|
|
62
|
+
<Layers size={16} className="mr-2" />
|
|
63
|
+
New Sprint
|
|
64
|
+
</Button>
|
|
65
|
+
<Button
|
|
66
|
+
onClick={() => setIsTaskModalOpen(true)}
|
|
67
|
+
className="h-9 shadow-lg shadow-primary/20"
|
|
68
|
+
>
|
|
69
|
+
<Plus size={16} className="mr-2" />
|
|
70
|
+
New Task
|
|
71
|
+
</Button>
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
const headerStats = (
|
|
76
|
+
<div className="flex items-center gap-2">
|
|
77
|
+
<span className="text-primary font-bold">{tasks.length} tasks</span>
|
|
78
|
+
<span className="w-1 h-1 rounded-full bg-muted-foreground/30" />
|
|
79
|
+
<span>{sprints.length} sprints</span>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<DndContext
|
|
85
|
+
sensors={sensors}
|
|
86
|
+
collisionDetection={closestCenter}
|
|
87
|
+
onDragStart={handleDragStart}
|
|
88
|
+
onDragEnd={handleDragEnd}
|
|
89
|
+
>
|
|
90
|
+
<PageLayout
|
|
91
|
+
title="Backlog"
|
|
92
|
+
description={headerStats}
|
|
93
|
+
actions={headerActions}
|
|
94
|
+
>
|
|
95
|
+
<div className="space-y-4">
|
|
96
|
+
<AnimatePresence mode="popLayout">
|
|
97
|
+
{/* 1. Active Sprint */}
|
|
98
|
+
{activeSprint && (
|
|
99
|
+
<SprintSection
|
|
100
|
+
key={`section-active-${activeSprint.id}`}
|
|
101
|
+
sprint={activeSprint}
|
|
102
|
+
tasks={getSprintTasks(activeSprint.id)}
|
|
103
|
+
isExpanded={expandedSections.has("active")}
|
|
104
|
+
onToggle={() => toggleSection("active")}
|
|
105
|
+
isActive={true}
|
|
106
|
+
onComplete={handleCompleteSprint}
|
|
107
|
+
onTaskClick={setSelectedTaskId}
|
|
108
|
+
onTaskDelete={handleDeleteTask}
|
|
109
|
+
isSubmitting={isSubmitting}
|
|
110
|
+
/>
|
|
111
|
+
)}
|
|
112
|
+
|
|
113
|
+
{/* 2. Planned Sprints */}
|
|
114
|
+
{plannedSprints.map((sprint) => (
|
|
115
|
+
<SprintSection
|
|
116
|
+
key={`section-planned-${sprint.id}`}
|
|
117
|
+
sprint={sprint}
|
|
118
|
+
tasks={getSprintTasks(sprint.id)}
|
|
119
|
+
isExpanded={expandedSections.has(`planned-${sprint.id}`)}
|
|
120
|
+
onToggle={() => toggleSection(`planned-${sprint.id}`)}
|
|
121
|
+
canStart={!activeSprint}
|
|
122
|
+
onStart={handleStartSprint}
|
|
123
|
+
onTaskClick={setSelectedTaskId}
|
|
124
|
+
onTaskDelete={handleDeleteTask}
|
|
125
|
+
isSubmitting={isSubmitting}
|
|
126
|
+
/>
|
|
127
|
+
))}
|
|
128
|
+
|
|
129
|
+
{/* 3. Backlog Section */}
|
|
130
|
+
<BacklogList
|
|
131
|
+
key="backlog-list"
|
|
132
|
+
tasks={backlogTasks}
|
|
133
|
+
isExpanded={expandedSections.has("backlog")}
|
|
134
|
+
onToggle={() => toggleSection("backlog")}
|
|
135
|
+
onTaskClick={setSelectedTaskId}
|
|
136
|
+
onTaskDelete={handleDeleteTask}
|
|
137
|
+
/>
|
|
138
|
+
|
|
139
|
+
{/* 4. Completed Sprints */}
|
|
140
|
+
<CompletedSprintsSection
|
|
141
|
+
key="completed-sprints"
|
|
142
|
+
sprints={completedSprints}
|
|
143
|
+
isExpanded={expandedSections.has("completed")}
|
|
144
|
+
onToggle={() => toggleSection("completed")}
|
|
145
|
+
getSprintTasks={getSprintTasks}
|
|
146
|
+
expandedSprints={expandedSections}
|
|
147
|
+
onToggleSprint={toggleSection}
|
|
148
|
+
onTaskClick={setSelectedTaskId}
|
|
149
|
+
/>
|
|
150
|
+
</AnimatePresence>
|
|
151
|
+
</div>
|
|
152
|
+
</PageLayout>
|
|
153
|
+
|
|
154
|
+
{/* Drag Overlay */}
|
|
155
|
+
<DragOverlay>
|
|
156
|
+
{activeTask && (
|
|
157
|
+
<div className="opacity-80 rotate-1 shadow-2xl cursor-grabbing scale-105 transition-transform duration-200">
|
|
158
|
+
<TaskCard task={activeTask} variant="list" />
|
|
159
|
+
</div>
|
|
160
|
+
)}
|
|
161
|
+
</DragOverlay>
|
|
162
|
+
|
|
163
|
+
{/* Modals */}
|
|
164
|
+
<TaskCreateModal
|
|
165
|
+
isOpen={isTaskModalOpen}
|
|
166
|
+
onClose={() => setIsTaskModalOpen(false)}
|
|
167
|
+
onCreated={() => {
|
|
168
|
+
refetchTasks();
|
|
169
|
+
setIsTaskModalOpen(false);
|
|
170
|
+
}}
|
|
171
|
+
/>
|
|
172
|
+
|
|
173
|
+
<SprintCreateModal
|
|
174
|
+
isOpen={isSprintModalOpen}
|
|
175
|
+
onClose={() => setIsSprintModalOpen(false)}
|
|
176
|
+
onCreated={handleCreateSprint}
|
|
177
|
+
isSubmitting={isSubmitting}
|
|
178
|
+
/>
|
|
179
|
+
|
|
180
|
+
{selectedTaskId && (
|
|
181
|
+
<TaskPanel
|
|
182
|
+
taskId={selectedTaskId}
|
|
183
|
+
onClose={() => setSelectedTaskId(null)}
|
|
184
|
+
onUpdated={() => {
|
|
185
|
+
refetchTasks();
|
|
186
|
+
}}
|
|
187
|
+
onDeleted={() => {
|
|
188
|
+
refetchTasks();
|
|
189
|
+
setSelectedTaskId(null);
|
|
190
|
+
}}
|
|
191
|
+
/>
|
|
192
|
+
)}
|
|
193
|
+
</DndContext>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { LayoutGrid, Map as MapIcon } from "lucide-react";
|
|
4
|
+
import {
|
|
5
|
+
BoardFilter,
|
|
6
|
+
PageLayout,
|
|
7
|
+
TaskCreateModal,
|
|
8
|
+
TaskPanel,
|
|
9
|
+
} from "@/components";
|
|
10
|
+
import { BoardContent, BoardHeader, SprintMindmap } from "@/components/board";
|
|
11
|
+
import { Button, Spinner } from "@/components/ui";
|
|
12
|
+
import { useBoard } from "@/hooks";
|
|
13
|
+
|
|
14
|
+
export default function BoardPage() {
|
|
15
|
+
const {
|
|
16
|
+
activeSprint,
|
|
17
|
+
filteredTasks,
|
|
18
|
+
tasksByStatus,
|
|
19
|
+
activeTask,
|
|
20
|
+
isLoading,
|
|
21
|
+
shouldShowEmptyState,
|
|
22
|
+
isCreateModalOpen,
|
|
23
|
+
setIsCreateModalOpen,
|
|
24
|
+
selectedTaskId,
|
|
25
|
+
setSelectedTaskId,
|
|
26
|
+
searchQuery,
|
|
27
|
+
setSearchQuery,
|
|
28
|
+
priorityFilter,
|
|
29
|
+
setPriorityFilter,
|
|
30
|
+
roleFilter,
|
|
31
|
+
setRoleFilter,
|
|
32
|
+
view,
|
|
33
|
+
setView,
|
|
34
|
+
sensors,
|
|
35
|
+
handleDragStart,
|
|
36
|
+
handleDragEnd,
|
|
37
|
+
handleDeleteTask,
|
|
38
|
+
refetch,
|
|
39
|
+
} = useBoard();
|
|
40
|
+
|
|
41
|
+
if (isLoading) {
|
|
42
|
+
return (
|
|
43
|
+
<div className="flex items-center justify-center h-full">
|
|
44
|
+
<Spinner size="lg" />
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const { title, description, actions } = BoardHeader({
|
|
50
|
+
activeSprint,
|
|
51
|
+
filteredTasksCount: filteredTasks.length,
|
|
52
|
+
onNewTask: () => setIsCreateModalOpen(true),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<>
|
|
57
|
+
<PageLayout
|
|
58
|
+
title={title}
|
|
59
|
+
description={description}
|
|
60
|
+
actions={actions}
|
|
61
|
+
contentClassName="flex flex-col"
|
|
62
|
+
>
|
|
63
|
+
{activeSprint != null && (
|
|
64
|
+
<div className="flex items-center justify-between gap-4 mb-6">
|
|
65
|
+
<BoardFilter
|
|
66
|
+
searchQuery={searchQuery}
|
|
67
|
+
onSearchChange={setSearchQuery}
|
|
68
|
+
priorityFilter={priorityFilter}
|
|
69
|
+
onPriorityChange={setPriorityFilter}
|
|
70
|
+
roleFilter={roleFilter}
|
|
71
|
+
onRoleChange={setRoleFilter}
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<div className="flex items-center bg-muted/50 p-1 rounded-lg border">
|
|
75
|
+
<Button
|
|
76
|
+
variant={view === "board" ? "secondary" : "ghost"}
|
|
77
|
+
size="sm"
|
|
78
|
+
className="gap-2"
|
|
79
|
+
onClick={() => setView("board")}
|
|
80
|
+
>
|
|
81
|
+
<LayoutGrid className="w-4 h-4" />
|
|
82
|
+
Board
|
|
83
|
+
</Button>
|
|
84
|
+
<Button
|
|
85
|
+
variant={view === "mindmap" ? "secondary" : "ghost"}
|
|
86
|
+
size="sm"
|
|
87
|
+
className="gap-2"
|
|
88
|
+
onClick={() => setView("mindmap")}
|
|
89
|
+
>
|
|
90
|
+
<MapIcon className="w-4 h-4" />
|
|
91
|
+
Mindmap
|
|
92
|
+
</Button>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
)}
|
|
96
|
+
|
|
97
|
+
{view === "board" ? (
|
|
98
|
+
<BoardContent
|
|
99
|
+
filteredTasks={filteredTasks}
|
|
100
|
+
tasksByStatus={tasksByStatus}
|
|
101
|
+
shouldShowEmptyState={shouldShowEmptyState}
|
|
102
|
+
activeTask={activeTask}
|
|
103
|
+
sensors={sensors}
|
|
104
|
+
onDragStart={handleDragStart}
|
|
105
|
+
onDragEnd={handleDragEnd}
|
|
106
|
+
onTaskClick={setSelectedTaskId}
|
|
107
|
+
onTaskDelete={handleDeleteTask}
|
|
108
|
+
onNewTask={() => setIsCreateModalOpen(true)}
|
|
109
|
+
/>
|
|
110
|
+
) : (
|
|
111
|
+
<SprintMindmap mindmap={activeSprint?.mindmap || null} />
|
|
112
|
+
)}
|
|
113
|
+
</PageLayout>
|
|
114
|
+
|
|
115
|
+
{/* Modals */}
|
|
116
|
+
<TaskCreateModal
|
|
117
|
+
isOpen={isCreateModalOpen}
|
|
118
|
+
onClose={() => setIsCreateModalOpen(false)}
|
|
119
|
+
onCreated={() => {
|
|
120
|
+
refetch();
|
|
121
|
+
setIsCreateModalOpen(false);
|
|
122
|
+
}}
|
|
123
|
+
defaultSprintId={activeSprint?.id}
|
|
124
|
+
/>
|
|
125
|
+
|
|
126
|
+
{selectedTaskId && (
|
|
127
|
+
<TaskPanel
|
|
128
|
+
taskId={selectedTaskId}
|
|
129
|
+
onClose={() => setSelectedTaskId(null)}
|
|
130
|
+
onUpdated={() => {
|
|
131
|
+
refetch();
|
|
132
|
+
}}
|
|
133
|
+
onDeleted={() => {
|
|
134
|
+
refetch();
|
|
135
|
+
setSelectedTaskId(null);
|
|
136
|
+
}}
|
|
137
|
+
/>
|
|
138
|
+
)}
|
|
139
|
+
</>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Sidebar, WorkspaceProtected } from "@/components";
|
|
4
|
+
import { LoadingSkeleton } from "@/components/ui";
|
|
5
|
+
import { useDashboardLayout } from "@/hooks/useDashboardLayout";
|
|
6
|
+
|
|
7
|
+
export default function DashboardLayout({
|
|
8
|
+
children,
|
|
9
|
+
}: {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}) {
|
|
12
|
+
const { isLoading, isAuthenticated, shouldShowUI } = useDashboardLayout();
|
|
13
|
+
|
|
14
|
+
// Show loading skeleton while authenticating
|
|
15
|
+
if (isLoading) {
|
|
16
|
+
return <LoadingSkeleton />;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Don't render anything if not authenticated (redirect happens in hook)
|
|
20
|
+
if (!shouldShowUI) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div className="flex h-screen overflow-hidden bg-background">
|
|
26
|
+
{isAuthenticated && <Sidebar />}
|
|
27
|
+
<main className="flex-1 overflow-auto bg-background p-6">
|
|
28
|
+
<WorkspaceProtected>{children}</WorkspaceProtected>
|
|
29
|
+
</main>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { ChevronRight, Trash2, Users } from "lucide-react";
|
|
4
|
+
import Link from "next/link";
|
|
5
|
+
import { useRouter } from "next/navigation";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { toast } from "sonner";
|
|
8
|
+
import { PageLayout } from "@/components/PageLayout";
|
|
9
|
+
import { ApiKeysSettings } from "@/components/settings/ApiKeysSettings";
|
|
10
|
+
import { SettingItem } from "@/components/settings/SettingItem";
|
|
11
|
+
import { SettingSection } from "@/components/settings/SettingSection";
|
|
12
|
+
import { Button, Input, Modal } from "@/components/ui";
|
|
13
|
+
import { useAuth } from "@/context";
|
|
14
|
+
import { useAuthenticatedUser, useOrganizationQuery } from "@/hooks";
|
|
15
|
+
import { locusClient } from "@/lib/api-client";
|
|
16
|
+
|
|
17
|
+
export default function SettingsPage() {
|
|
18
|
+
const user = useAuthenticatedUser();
|
|
19
|
+
const { logout } = useAuth();
|
|
20
|
+
const router = useRouter();
|
|
21
|
+
const { data: organization } = useOrganizationQuery();
|
|
22
|
+
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
|
|
23
|
+
const [deleteConfirmation, setDeleteConfirmation] = useState("");
|
|
24
|
+
const [isDeleting, setIsDeleting] = useState(false);
|
|
25
|
+
|
|
26
|
+
const orgName = organization?.name || "organization";
|
|
27
|
+
|
|
28
|
+
const handleDeleteOrganization = async () => {
|
|
29
|
+
if (!user?.orgId) return;
|
|
30
|
+
|
|
31
|
+
const expectedConfirmation = `delete ${orgName}`.toLowerCase();
|
|
32
|
+
if (deleteConfirmation.toLowerCase() !== expectedConfirmation) {
|
|
33
|
+
toast.error(`Please type "delete ${orgName}" to confirm`);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
setIsDeleting(true);
|
|
38
|
+
try {
|
|
39
|
+
await locusClient.organizations.delete(user.orgId);
|
|
40
|
+
toast.success("Organization deleted");
|
|
41
|
+
|
|
42
|
+
// Logout the user
|
|
43
|
+
logout();
|
|
44
|
+
|
|
45
|
+
// Redirect to login
|
|
46
|
+
router.push("/login");
|
|
47
|
+
} catch (error) {
|
|
48
|
+
toast.error(
|
|
49
|
+
error instanceof Error ? error.message : "Failed to delete organization"
|
|
50
|
+
);
|
|
51
|
+
} finally {
|
|
52
|
+
setIsDeleting(false);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<PageLayout
|
|
58
|
+
title="Settings"
|
|
59
|
+
description="Manage your workspace preferences and configuration."
|
|
60
|
+
>
|
|
61
|
+
<div className="max-w-5xl space-y-8">
|
|
62
|
+
{/* Organization Section */}
|
|
63
|
+
<SettingSection title="Organization">
|
|
64
|
+
<Link href="/settings/team">
|
|
65
|
+
<SettingItem
|
|
66
|
+
icon={<Users size={18} />}
|
|
67
|
+
title="Team"
|
|
68
|
+
description="Invite and manage organization members"
|
|
69
|
+
>
|
|
70
|
+
<div className="text-muted-foreground">
|
|
71
|
+
<ChevronRight size={20} />
|
|
72
|
+
</div>
|
|
73
|
+
</SettingItem>
|
|
74
|
+
</Link>
|
|
75
|
+
</SettingSection>
|
|
76
|
+
|
|
77
|
+
{/* API Keys Section */}
|
|
78
|
+
<ApiKeysSettings />
|
|
79
|
+
|
|
80
|
+
{/* Danger Zone */}
|
|
81
|
+
<div>
|
|
82
|
+
<h3 className="text-xs font-bold uppercase tracking-widest text-destructive mb-4 px-4">
|
|
83
|
+
Danger Zone
|
|
84
|
+
</h3>
|
|
85
|
+
<div className="bg-destructive/5 border border-destructive/20 rounded-2xl p-6">
|
|
86
|
+
<div className="flex items-center justify-between">
|
|
87
|
+
<div>
|
|
88
|
+
<h4 className="font-medium text-foreground">
|
|
89
|
+
Delete Organization
|
|
90
|
+
</h4>
|
|
91
|
+
<p className="text-sm text-muted-foreground mt-0.5">
|
|
92
|
+
Permanently delete this organization and all its data
|
|
93
|
+
</p>
|
|
94
|
+
</div>
|
|
95
|
+
<Button
|
|
96
|
+
variant="danger"
|
|
97
|
+
size="sm"
|
|
98
|
+
onClick={() => setIsDeleteModalOpen(true)}
|
|
99
|
+
>
|
|
100
|
+
<Trash2 size={18} />
|
|
101
|
+
Delete
|
|
102
|
+
</Button>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
{/* Delete Organization Modal */}
|
|
109
|
+
<Modal
|
|
110
|
+
isOpen={isDeleteModalOpen}
|
|
111
|
+
onClose={() => setIsDeleteModalOpen(false)}
|
|
112
|
+
>
|
|
113
|
+
<div className="space-y-4">
|
|
114
|
+
<div>
|
|
115
|
+
<h2 className="text-xl font-bold text-foreground">
|
|
116
|
+
Delete Organization
|
|
117
|
+
</h2>
|
|
118
|
+
<p className="text-sm text-muted-foreground mt-1">
|
|
119
|
+
This action cannot be undone. All organization data will be
|
|
120
|
+
permanently deleted.
|
|
121
|
+
</p>
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<div className="space-y-2">
|
|
125
|
+
<label className="text-sm font-medium text-foreground">
|
|
126
|
+
Type "delete {orgName}" to confirm
|
|
127
|
+
</label>
|
|
128
|
+
<Input
|
|
129
|
+
placeholder={`delete ${orgName}`}
|
|
130
|
+
value={deleteConfirmation}
|
|
131
|
+
onChange={(e) => setDeleteConfirmation(e.target.value)}
|
|
132
|
+
disabled={isDeleting}
|
|
133
|
+
/>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
<div className="flex gap-3 justify-end pt-4">
|
|
137
|
+
<Button
|
|
138
|
+
variant="secondary"
|
|
139
|
+
onClick={() => setIsDeleteModalOpen(false)}
|
|
140
|
+
disabled={isDeleting}
|
|
141
|
+
>
|
|
142
|
+
Cancel
|
|
143
|
+
</Button>
|
|
144
|
+
<Button
|
|
145
|
+
variant="danger"
|
|
146
|
+
onClick={handleDeleteOrganization}
|
|
147
|
+
disabled={
|
|
148
|
+
isDeleting ||
|
|
149
|
+
deleteConfirmation.toLowerCase() !==
|
|
150
|
+
`delete ${orgName}`.toLowerCase()
|
|
151
|
+
}
|
|
152
|
+
isLoading={isDeleting}
|
|
153
|
+
>
|
|
154
|
+
Delete Organization
|
|
155
|
+
</Button>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
</Modal>
|
|
159
|
+
</PageLayout>
|
|
160
|
+
);
|
|
161
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { UserPlus } from "lucide-react";
|
|
4
|
+
import { PageLayout } from "@/components";
|
|
5
|
+
import { InviteMemberModal } from "@/components/settings";
|
|
6
|
+
import { TeamInvitationsList } from "@/components/settings/TeamInvitationsList";
|
|
7
|
+
import { TeamMembersList } from "@/components/settings/TeamMembersList";
|
|
8
|
+
import { Button } from "@/components/ui";
|
|
9
|
+
import { useTeamManagement } from "@/hooks/useTeamManagement";
|
|
10
|
+
|
|
11
|
+
export default function TeamPage() {
|
|
12
|
+
const {
|
|
13
|
+
currentUser,
|
|
14
|
+
members,
|
|
15
|
+
invitations,
|
|
16
|
+
isLoading,
|
|
17
|
+
canManage,
|
|
18
|
+
isInviteModalOpen,
|
|
19
|
+
setIsInviteModalOpen,
|
|
20
|
+
handleRemoveMember,
|
|
21
|
+
handleRevokeInvitation,
|
|
22
|
+
handleCopyLink,
|
|
23
|
+
} = useTeamManagement();
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<PageLayout
|
|
27
|
+
title="Team Management"
|
|
28
|
+
description="Manage your organization members and invitations."
|
|
29
|
+
actions={
|
|
30
|
+
canManage ? (
|
|
31
|
+
<Button onClick={() => setIsInviteModalOpen(true)}>
|
|
32
|
+
<UserPlus size={18} />
|
|
33
|
+
Invite Member
|
|
34
|
+
</Button>
|
|
35
|
+
) : undefined
|
|
36
|
+
}
|
|
37
|
+
>
|
|
38
|
+
<div className="space-y-8">
|
|
39
|
+
{/* Members List */}
|
|
40
|
+
<section className="space-y-4">
|
|
41
|
+
<div className="flex items-center justify-between px-1">
|
|
42
|
+
<h3 className="text-sm font-semibold text-muted-foreground uppercase tracking-wider">
|
|
43
|
+
Members ({members.length})
|
|
44
|
+
</h3>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div className="bg-card/50 border border-secondary/20 rounded-2xl overflow-hidden">
|
|
48
|
+
<TeamMembersList
|
|
49
|
+
members={members}
|
|
50
|
+
currentUserId={currentUser.id}
|
|
51
|
+
canManage={canManage}
|
|
52
|
+
isLoading={isLoading}
|
|
53
|
+
onRemoveMember={handleRemoveMember}
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
</section>
|
|
57
|
+
|
|
58
|
+
{/* Pending Invitations */}
|
|
59
|
+
{!isLoading && (
|
|
60
|
+
<TeamInvitationsList
|
|
61
|
+
invitations={invitations}
|
|
62
|
+
canManage={canManage}
|
|
63
|
+
onCopyLink={handleCopyLink}
|
|
64
|
+
onRevokeInvitation={handleRevokeInvitation}
|
|
65
|
+
/>
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<InviteMemberModal
|
|
70
|
+
isOpen={isInviteModalOpen}
|
|
71
|
+
onClose={() => setIsInviteModalOpen(false)}
|
|
72
|
+
/>
|
|
73
|
+
</PageLayout>
|
|
74
|
+
);
|
|
75
|
+
}
|