11'use client'
22
3- import { useState } from 'react'
3+ import { useState } from 'react'
44import { Layout } from '@/components/layout/Layout'
55import { Card , CardContent , CardHeader , CardTitle } from '@/components/ui/card'
66import { Button } from '@/components/ui/button'
77import { Input } from '@/components/ui/input'
8- import { usePreferencesStore } from '@/stores'
8+ import { usePreferencesStore } from '@/stores'
99import { useRequireAuth } from '@/hooks/useAuth'
1010import { ThemeSelector } from '@/components/theme/ThemeToggle'
11+ import { GitHubTokenSetup } from '@/components/common/GitHubTokenSetup'
1112import { cookieUtils } from '@/lib/cookies'
1213
1314export default function SettingsPage ( ) {
14- const { isLoading, orgData } = useRequireAuth ( )
15+ const { isLoading, orgData } = useRequireAuth ( )
1516 const { resetPreferences } = usePreferencesStore ( )
1617 const [ tempOrgName , setTempOrgName ] = useState ( orgData ?. orgName || '' )
17- const [ tempToken , setTempToken ] = useState ( '' )
1818
1919 const handleClearData = ( ) => {
2020 if ( confirm ( 'Tüm veriler silinecek. Emin misiniz?' ) ) {
@@ -25,8 +25,6 @@ export default function SettingsPage() {
2525 }
2626 }
2727
28-
29-
3028 if ( isLoading ) {
3129 return (
3230 < Layout >
@@ -42,10 +40,17 @@ export default function SettingsPage() {
4240
4341 return (
4442 < Layout >
45- < div className = "max-w-2xl" >
46- < h2 className = "text-xl font-semibold mb-4" > Ayarlar</ h2 >
43+ < div className = "max-w-4xl mx-auto" >
44+ < h2 className = "text-xl font-semibold mb-6" > Ayarlar</ h2 >
45+
46+ < div className = "space-y-8" >
47+
48+ { /* GitHub API Token Setup */ }
49+ < section >
50+ < h3 className = "text-lg font-medium mb-4" > 🔑 GitHub API Token</ h3 >
51+ < GitHubTokenSetup />
52+ </ section >
4753
48- < div className = "space-y-6" >
4954 < Card >
5055 < CardHeader >
5156 < CardTitle > GitHub Bağlantısı</ CardTitle >
@@ -60,19 +65,6 @@ export default function SettingsPage() {
6065 />
6166 </ div >
6267
63- < div >
64- < label className = "block text-sm font-medium mb-2" > API Token (Opsiyonel)</ label >
65- < Input
66- type = "password"
67- value = { tempToken }
68- onChange = { ( e ) => setTempToken ( e . target . value ) }
69- placeholder = "Mevcut token'ı değiştirmek için girin"
70- />
71- < p className = "text-xs text-gray-500 mt-1" >
72- Token olmadan da çalışır, ancak rate limit düşük olur.
73- </ p >
74- </ div >
75-
7668 < Button >
7769 Kaydet
7870 </ Button >
0 commit comments