import { useNotesStore } from "../../store/notesStore";

export default function TitleInput() {
  const activeNote = useNotesStore((state) => state.activeNote);
  const updateActive = useNotesStore((state) => state.updateActive);

  if (!activeNote) {
    return null;
  }

  return (
    <input
      className="w-full bg-transparent font-display text-3xl text-[var(--ink)] outline-none"
      value={activeNote.title}
      onChange={(event) => updateActive(event.target.value, activeNote.content)}
      placeholder="Baslik"
    />
  );
}
