Files
nextjs-boilerplate/app/[locale]/admin/tutorials/page.tsx
T

30 lines
978 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { supabaseAdmin } from '@/lib/supabaseAdmin'
import { TutorialsClient, TutorialItem } from './TutorialsClient'
export const dynamic = 'force-dynamic'
export default async function AdminTutorialsPage() {
const { data: tutorials, error } = await supabaseAdmin
.from('tutorials')
.select('*')
.order('sort_order', { ascending: true })
const items: TutorialItem[] = (tutorials || []).map((t: any) => ({
id: t.id,
title: t.title,
description: t.description || '',
category: t.category || 'basics',
category_label: t.category_label || '🚀 Hızlı Başlangıç',
duration: t.duration || '03:00',
youtube_id: t.youtube_id,
target_view: t.target_view,
target_view_label: t.target_view_label,
highlights: Array.isArray(t.highlights) ? t.highlights : [],
sort_order: t.sort_order || 0,
is_active: t.is_active !== false,
created_at: t.created_at,
}))
return <TutorialsClient initialTutorials={items} />
}