2026-08-09 11:35:42 -07:00
|
|
|
import Modal from "../ui/Modal";
|
|
|
|
|
import Button from "../ui/Button";
|
|
|
|
|
import ClaudeInstructionsEditor from "./ClaudeInstructionsEditor";
|
2026-03-01 01:21:33 +00:00
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
instructions: string;
|
|
|
|
|
disabled: boolean;
|
|
|
|
|
onSave: (instructions: string) => Promise<void>;
|
|
|
|
|
onClose: () => void;
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-09 11:35:42 -07:00
|
|
|
/** Global Claude instructions (Settings). Per-project lives in Config → Runtime. */
|
|
|
|
|
export default function ClaudeInstructionsModal({
|
|
|
|
|
instructions,
|
|
|
|
|
disabled,
|
|
|
|
|
onSave,
|
|
|
|
|
onClose,
|
|
|
|
|
}: Props) {
|
2026-03-01 01:21:33 +00:00
|
|
|
return (
|
2026-08-09 11:35:42 -07:00
|
|
|
<Modal
|
|
|
|
|
title="Claude Instructions"
|
|
|
|
|
description="Written to ~/.claude/CLAUDE.md inside containers."
|
|
|
|
|
onClose={onClose}
|
|
|
|
|
widthClassName="w-[40rem]"
|
|
|
|
|
footer={<Button onClick={onClose}>Close</Button>}
|
2026-03-01 01:21:33 +00:00
|
|
|
>
|
2026-08-09 11:35:42 -07:00
|
|
|
<ClaudeInstructionsEditor
|
|
|
|
|
instructions={instructions}
|
|
|
|
|
disabled={disabled}
|
|
|
|
|
disabledReason="Container must be stopped to change Claude instructions."
|
|
|
|
|
rows={14}
|
|
|
|
|
autoFocus
|
|
|
|
|
onSave={async (value) => {
|
|
|
|
|
try {
|
|
|
|
|
await onSave(value);
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error("Failed to update Claude instructions:", err);
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Modal>
|
2026-03-01 01:21:33 +00:00
|
|
|
);
|
|
|
|
|
}
|