diff --git a/src/pages/Settings.tsx b/src/pages/Settings.tsx new file mode 100644 index 0000000..0283879 --- /dev/null +++ b/src/pages/Settings.tsx @@ -0,0 +1,286 @@ +import { useState } from "react"; +import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { Separator } from "@/components/ui/separator"; +import { Switch } from "@/components/ui/switch"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { Avatar, AvatarFallback } from "@/components/ui/avatar"; +import { Progress } from "@/components/ui/progress"; +import { + Settings2, Users, Puzzle, Key, Copy, RefreshCw, Eye, EyeOff, + Shield, Globe, Bell, Trash2, Plus, ExternalLink +} from "lucide-react"; +import { toast } from "sonner"; +import Sidebar from "@/components/Sidebar"; +import Header from "@/components/Header"; + +const teamMembers = [ + { name: "Sarah Kim", email: "sarah@example.com", initials: "SK", color: "bg-blue-500", role: "Admin" }, + { name: "Alex Lee", email: "alex@example.com", initials: "AL", color: "bg-sky-500", role: "Editor" }, + { name: "Nina Kumar", email: "nina@example.com", initials: "NK", color: "bg-emerald-500", role: "Editor" }, + { name: "Raj Joshi", email: "raj@example.com", initials: "RJ", color: "bg-indigo-500", role: "Viewer" }, +]; + +const integrations = [ + { name: "Slack", description: "Send notifications to Slack channels", connected: true, icon: "S", color: "bg-purple-500" }, + { name: "Jira", description: "Two-way sync with Jira issues", connected: true, icon: "J", color: "bg-blue-500" }, + { name: "Linear", description: "Import and sync with Linear projects", connected: false, icon: "L", color: "bg-indigo-500" }, + { name: "GitHub", description: "Link features to pull requests", connected: false, icon: "G", color: "bg-slate-800" }, +]; + +export default function SettingsPage() { + const [showApiKey, setShowApiKey] = useState(false); + const apiKey = "pk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"; + const maskedKey = "pk_live_****************************o5p6"; + + const handleCopyKey = () => { + toast("API key copied to clipboard!"); + }; + + const handleRegenerate = () => { + toast("API key regenerated successfully!"); + }; + + return ( +
+ +
+
+
+ {/* ── Page Header ── */} +
+

Settings

+

Manage your workspace preferences

+
+ + {/* ── Settings Tabs ── */} + + + + General + + + Team + + + Integrations + + + API + + + + {/* ── General Tab ── */} + + + + Workspace Settings + Configure your workspace name and preferences + + +
+
+ + +
+
+ + +
+
+ +
+

Notifications

+
+
+

Email Notifications

+

Receive email updates for feature changes

+
+ +
+
+
+

Slack Notifications

+

Push notifications to connected Slack channels

+
+ +
+
+
+

Weekly Digest

+

Receive a weekly summary of product activity

+
+ +
+
+
+ +
+
+
+
+ + {/* ── Team Tab ── */} + + + +
+ Team Members + {teamMembers.length} members in your workspace +
+ +
+ +
+ {teamMembers.map((member, i) => ( +
+
+ + {member.initials} + +
+

{member.name}

+

{member.email}

+
+
+
+ {member.role} + {member.role !== "Admin" && ( + + )} +
+
+ ))} +
+
+
+
+ + {/* ── Integrations Tab ── */} + + + + Integrations + Connect your favorite tools to streamline your workflow + + +
+ {integrations.map((integration, i) => ( +
+
+
+ {integration.icon} +
+
+

{integration.name}

+

{integration.description}

+
+
+
+ {integration.connected ? ( + <> + Connected + + + ) : ( + + )} +
+
+ ))} +
+
+
+
+ + {/* ── API Tab ── */} + + + + API Key + Use your API key to access the ProductLab API programmatically + + +
+ +
+
+ + +
+ + +
+

+ Keep your API key secret. Do not share it publicly. +

+
+ + + + {/* Usage Stats */} +
+

API Usage (This Month)

+
+
+

12,847

+

Total Requests

+
+
+

142ms

+

Avg Response Time

+
+
+

99.8%

+

Success Rate

+
+
+
+
+ Rate Limit Usage + 12,847 / 50,000 +
+ +

26% of monthly limit used

+
+
+ + + + {/* API Docs Link */} +
+
+

API Documentation

+

Explore endpoints, authentication, and examples

+
+ +
+
+
+
+
+
+
+
+ ); +}