Files
pablan/frontend/src/lib/components/FormField.svelte
T
ProfessorNovaandClaude Opus 5 97dbff309c Pablan, as it stands
Self-hosted knowledge management for SMEs: a split-screen Markdown editor
whose sections an LLM refines while you write, and RAG question answering
over the documents that result. FastAPI + Postgres/pgvector on the back,
SvelteKit on the front, everything OpenAI-compatible and self-hostable.

Squashed into a single commit; the development history stays local.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CA43ZJda8Rbp2hKXNy8f6b
2026-09-04 08:36:17 +02:00

28 lines
761 B
Svelte

<script lang="ts">
import { Label } from 'bits-ui';
import type { Snippet } from 'svelte';
type Props = {
label: string;
for: string;
error?: string | null;
/** Rendered on the label line, right-aligned — for provenance or a
* per-field action that would clutter the field itself. */
hint?: Snippet;
children: Snippet;
};
let { label, for: htmlFor, error = null, hint, children }: Props = $props();
</script>
<div class="flex flex-col gap-1.5">
<div class="flex items-center justify-between gap-2">
<Label.Root for={htmlFor} class="text-sm font-medium text-ink">{label}</Label.Root>
{#if hint}{@render hint()}{/if}
</div>
{@render children()}
{#if error}
<p role="alert" class="text-sm text-danger">{error}</p>
{/if}
</div>