Files
logbuch/src/components/admin/AdminField.tsx
T
Matthias Giesselmann b90ff252d1 Add Logbuch: project update blog with admin, media and API
Public archive with sidebar navigation, project pages, month archive,
search and entry pages with image blocks. Admin area for brands,
projects, post types, users, api clients, media and the entry editor
with drag and drop images, preview per audience, scheduling and
publish checks. Read and write API with bearer tokens, audience
scoping, idempotent creation, OpenAPI document and editorial guide.
Magic link login with configurable allowed domains, whole app behind
the session gate. 456 tests including design rule checks.
2026-07-31 21:33:42 +02:00

29 lines
677 B
TypeScript

import type { ReactNode } from 'react'
import { errorClass, hintClass, labelClass } from './styles'
export type AdminFieldProps = {
id: string
label: ReactNode
children: ReactNode
hint?: ReactNode
error?: ReactNode
className?: string
}
export function AdminField({ id, label, children, hint, error, className }: AdminFieldProps) {
return (
<div className={`flex min-w-0 flex-col gap-2 ${className ?? ''}`}>
<label htmlFor={id} className={labelClass}>
{label}
</label>
{children}
{hint ? <span className={hintClass}>{hint}</span> : null}
{error ? (
<span role="alert" className={errorClass}>
{error}
</span>
) : null}
</div>
)
}