Site içerik yönetimi

This commit is contained in:
2026-01-25 02:03:27 +03:00
parent 0fe49b5c96
commit 6992891ae3
9 changed files with 154 additions and 248 deletions

View File

@@ -0,0 +1,69 @@
"use client"
import { Button } from "@/components/ui/button"
import Link from "next/link"
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table"
import { Badge } from "@/components/ui/badge"
interface Profile {
id: string
full_name: string
role: string
created_at: string
}
interface UsersTableProps {
users: Profile[]
}
export function UsersTable({ users }: UsersTableProps) {
return (
<div className="space-y-4">
<div className="flex items-center justify-between space-y-2">
<h3 className="text-lg font-medium">Kullanıcı Listesi</h3>
{/*
<Link href="/dashboard/users/new">
<Button size="sm">Yeni Kullanıcı</Button>
</Link>
*/}
</div>
<div className="rounded-md border">
<Table>
<TableHeader>
<TableRow>
<TableHead>Ad Soyad</TableHead>
<TableHead>Rol</TableHead>
<TableHead>Kayıt Tarihi</TableHead>
<TableHead className="text-right">İşlemler</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{users?.map((profile) => (
<TableRow key={profile.id}>
<TableCell className="font-medium">{profile.full_name}</TableCell>
<TableCell>
<Badge variant={profile.role === 'admin' ? 'default' : 'secondary'}>
{profile.role === 'admin' ? 'Yönetici' : 'Kullanıcı'}
</Badge>
</TableCell>
<TableCell>{new Date(profile.created_at).toLocaleDateString('tr-TR')}</TableCell>
<TableCell className="text-right">
<Link href={`/dashboard/users/${profile.id}`}>
<Button variant="ghost" size="sm">Düzenle</Button>
</Link>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</div>
</div>
)
}