diff --git a/src/modules/admin/pages/courses/lessons/AddLesson.jsx b/src/modules/admin/pages/courses/lessons/AddLesson.jsx
index cfa7f49..f9f5fa2 100644
--- a/src/modules/admin/pages/courses/lessons/AddLesson.jsx
+++ b/src/modules/admin/pages/courses/lessons/AddLesson.jsx
@@ -56,7 +56,18 @@ function FieldError({ message }) {
// ─── Step 1 — Details ───────────────────────────────────────────────────────────
function StepDetails({ register, errors, control }) {
- const { fields, append, remove } = useFieldArray({ control, name: "objectives" });
+ const { fields, append, remove, insert, update } = useFieldArray({ control, name: "objectives" });
+
+ const handleObjectivePaste = (e, index) => {
+ const text = e.clipboardData.getData("text");
+ const lines = text.split(/\r\n|\r|\n/).map((l) => l.trim()).filter(Boolean);
+ if (lines.length <= 1) return;
+ e.preventDefault();
+ update(index, { value: lines[0] });
+ lines.slice(1).forEach((line, i) => {
+ insert(index + 1 + i, { value: line });
+ });
+ };
return (
@@ -101,7 +112,11 @@ function StepDetails({ register, errors, control }) {
{fields.map((field, index) => (
diff --git a/src/modules/admin/pages/library/units/AddLibraryUnit.jsx b/src/modules/admin/pages/library/units/AddLibraryUnit.jsx
index 776c74d..e8c100b 100644
--- a/src/modules/admin/pages/library/units/AddLibraryUnit.jsx
+++ b/src/modules/admin/pages/library/units/AddLibraryUnit.jsx
@@ -126,14 +126,29 @@ function StepUnit({ register, errors, control, setValue, tierCategories }) {
// ─── Step 2 — Lessons ──────────────────────────────────────────────────────────
function LessonObjectives({ control, register, lessonIndex }) {
- const { fields, append, remove } = useFieldArray({ control, name: `lessons.${lessonIndex}.objectives` });
+ const { fields, append, remove, insert, update } = useFieldArray({ control, name: `lessons.${lessonIndex}.objectives` });
+
+ const handleObjectivePaste = (e, oi) => {
+ const text = e.clipboardData.getData("text");
+ const lines = text.split(/\r\n|\r|\n/).map((l) => l.trim()).filter(Boolean);
+ if (lines.length <= 1) return;
+ e.preventDefault();
+ update(oi, { value: lines[0] });
+ lines.slice(1).forEach((line, i) => {
+ insert(oi + 1 + i, { value: line });
+ });
+ };
return (