feat: Implement course team management with dedicated UI and API, add course preview token generation, and refactor course settings UI.

This commit is contained in:
2026-02-18 00:01:47 -03:00
parent 89b1d1353d
commit f365e585a2
13 changed files with 798 additions and 301 deletions
+14 -2
View File
@@ -246,8 +246,20 @@ export default function CourseEditor({ params }: { params: { id: string } }) {
</div>
</div>
<div className="flex gap-3">
<button className="flex items-center gap-2 px-6 py-3 glass hover:bg-white/20 transition-all rounded-xl text-sm font-bold shadow-lg active:scale-95">
Preview
<button
onClick={async () => {
try {
const { token } = await cmsApi.getPreviewToken(params.id);
const expUrl = process.env.NEXT_PUBLIC_EXPERIENCE_URL || "http://localhost:3000";
window.open(`${expUrl}/courses/${params.id}?preview_token=${token}`, "_blank");
} catch (err) {
console.error("Failed to get preview token", err);
alert("Failed to start preview.");
}
}}
className="flex items-center gap-2 px-6 py-3 glass hover:bg-white/20 transition-all rounded-xl text-sm font-bold shadow-lg active:scale-95"
>
<PlayCircle size={18} /> Preview
</button>
<button
onClick={handlePublish}