export const dynamic = 'force-dynamic'
import { redirect } from 'next/navigation'
import { getAdminSession } from '@/lib/admin-auth'
import PasswortAendern from '@/components/admin/PasswortAendern'

export default async function PasswortPage() {
  const session = await getAdminSession()
  if (!session) redirect('/admin/login')

  return (
    <div style={{ padding: '32px', maxWidth: '600px' }}>
      <h1 style={{ fontSize: '20px', fontWeight: 800, color: 'var(--text-primary)', marginBottom: '8px' }}>
        Passwort ändern
      </h1>
      <p style={{ fontSize: '13px', color: 'var(--text-muted)', marginBottom: '28px' }}>
        Angemeldet als <strong>{session.email}</strong>
      </p>
      <PasswortAendern />
    </div>
  )
}
