import { MAX_FILE_PATH_LENGTH } from "../../constants.ts"; import type { RepositoryRow } from "../../db/index.ts"; import type { SessionUser } from "../../middleware/session.ts"; import { Layout } from "../layout.tsx"; import { RepoHeader } from "../repos/RepoHeader.tsx"; import { RepoNav } from "./RepoNav.tsx"; interface FileEditProps { user: SessionUser; repo: RepositoryRow; ref: string; filePath: string; content: string; error?: string; queryError?: string; } export function FileEdit({ user, repo, ref: editRef, filePath, content, error, queryError, }: FileEditProps) { const parts = filePath.split("/"); const filename = parts[parts.length - 1] ?? filePath; return (

WARNING: Line endings are normalized to LF (\n) on save.

{(!!error || !!queryError) && (

{error ?? queryError}

)}
{filename}

Committing directly to{" "} {editRef}

Cancel
); }