Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions platform/pages/ai-music-detection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ const AIMusicDetectionPage: NextPage = () => {
const formatFileSize = (bytes: number) => `${(bytes / 1024 / 1024).toFixed(2)} MB`

const resolveErrorMessage = (errorKey: string | null) => {
if (!errorKey) return null
if (!errorKey) {
return null
}
switch (errorKey) {
case 'enterUrl':
return t.aiDetection.errors?.enterUrl || t.aiDetection.error.title
Expand Down Expand Up @@ -153,14 +155,22 @@ const AIMusicDetectionPage: NextPage = () => {

const getDecisionLabel = (source: string) => {
const labels = t.aiDetection.result.sources
if (!labels) return source
if (source === 'music_ai') return labels.musicAi
if (source === 'ses_analizi') return labels.sesAnalizi
if (!labels) {
return source
}
if (source === 'music_ai') {
return labels.musicAi
}
if (source === 'ses_analizi') {
return labels.sesAnalizi
}
return labels.preview
}

const renderAnalysisResult = () => {
if (!analysisResult) return null
if (!analysisResult) {
return null
}

const confidence = Math.round(analysisResult.confidence * 100)
const decisionLabel = getDecisionLabel(analysisResult.decisionSource)
Expand Down
8 changes: 3 additions & 5 deletions platform/pages/crown-dreams/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
BookOpen,
X,
Clock,
Heart,
AlertTriangle,
Repeat,
Compass,
Expand All @@ -34,8 +33,7 @@ import {
formatDreamDate,
truncateDreamContent,
type DreamEntry,
type DreamType,
type EmotionType
type DreamType
} from '@/data/dreams'
import styles from '@/styles/pages/crown-dreams.module.css'

Expand All @@ -50,7 +48,7 @@ const DREAM_TYPE_ICONS: Record<DreamType, React.ReactNode> = {
}

const CrownDreamsPage: NextPage = () => {
const { language, t } = useLanguage()
const { language } = useLanguage()
const [selectedDream, setSelectedDream] = useState<DreamEntry | null>(null)
const [searchQuery, setSearchQuery] = useState('')
const [activeFilter, setActiveFilter] = useState<DreamType | 'all'>('all')
Expand Down Expand Up @@ -158,7 +156,7 @@ const CrownDreamsPage: NextPage = () => {
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.6, delay: 0.1 }}
>
{statCards.map((stat, i) => (
{statCards.map((stat) => (
<div key={stat.label} className={styles['stat-card']}>
<div className={styles['stat-header']}>
<div className={styles['stat-icon']}>
Expand Down
24 changes: 18 additions & 6 deletions platform/pages/crown-fortune/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ const CrownFortunePage: NextPage = () => {

// Load destiny
useEffect(() => {
if (!mounted) return
if (!mounted) {
return
}

const loadDestiny = () => {
const daily = getDailyDestiny()
Expand Down Expand Up @@ -145,7 +147,9 @@ const CrownFortunePage: NextPage = () => {

// Countdown
useEffect(() => {
if (!mounted) return
if (!mounted) {
return
}

const update = () => {
const ms = getTimeUntilMidnightGMT3()
Expand All @@ -162,7 +166,9 @@ const CrownFortunePage: NextPage = () => {

// Midnight reset check
useEffect(() => {
if (!mounted) return
if (!mounted) {
return
}

const check = () => {
const today = getTurkeyDate()
Expand All @@ -188,7 +194,9 @@ const CrownFortunePage: NextPage = () => {
}, [mounted, destiny])

const spinWheel = useCallback(() => {
if (!destiny || isSpinning || showCard) return
if (!destiny || isSpinning || showCard) {
return
}

setIsSpinning(true)

Expand All @@ -210,10 +218,14 @@ const CrownFortunePage: NextPage = () => {
}, [destiny, isSpinning, showCard])

const handleReverseDestiny = useCallback(() => {
if (!destiny) return
if (!destiny) {
return
}

// Zaten reverse ise veya flip devam ediyorsa işlem yapma
if (isReversed || isFlipping) return
if (isReversed || isFlipping) {
return
}

// Start flip animation
setIsFlipping(true)
Expand Down
6 changes: 3 additions & 3 deletions platform/pages/data-manipulation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import type { NextPage } from 'next'
import { motion, AnimatePresence } from 'framer-motion'
import { MainLayout } from '@/components/Layout/MainLayout'
import {
Upload,
RefreshCw,
Music,
FolderOpen,
Expand Down Expand Up @@ -117,8 +116,9 @@ const AudioDatasetPage: NextPage = () => {
const blob = await response.blob()
const url = window.URL.createObjectURL(blob)
setProcessedFileUrl(url)
} catch (err: any) {
setError(err.message || t.audioDataset.interface.errors.unexpected)
} catch (err: unknown) {
const errorMessage = err instanceof Error ? err.message : t.audioDataset.interface.errors.unexpected
setError(errorMessage)
} finally {
setIsProcessing(false)
}
Expand Down
Loading