patch curriculum..

This commit is contained in:
2026-08-07 10:27:41 +09:00
parent 604da5d6e1
commit 4c37717483
2 changed files with 22 additions and 2 deletions
+11 -1
View File
@@ -56,6 +56,7 @@ export function PlatformsPage({ session }: { session: AuthSession }) {
const [masterPlatforms, setMasterPlatforms] = useState<MasterPlatform[]>([]);
const [agents, setAgents] = useState<TeachingAgent[]>([]);
const [summary, setSummary] = useState<InstructorPlatformsSummary>(emptySummary);
const [loading, setLoading] = useState(true);
const [query, setQuery] = useState('');
const [error, setError] = useState<string | null>(null);
const [page, setPage] = useState(1);
@@ -137,6 +138,7 @@ export function PlatformsPage({ session }: { session: AuthSession }) {
useEffect(() => {
let cancelled = false;
setLoading(true);
listInstructorPlatforms(session.accessToken)
.then((payload) => {
if (!cancelled) applyPayload(payload);
@@ -147,6 +149,9 @@ export function PlatformsPage({ session }: { session: AuthSession }) {
setMasterPlatforms([]);
setSummary(emptySummary);
setError(reason.message);
})
.finally(() => {
if (!cancelled) setLoading(false);
});
return () => {
@@ -426,7 +431,12 @@ export function PlatformsPage({ session }: { session: AuthSession }) {
</div>
<div className="divide-y divide-[#e2e8f0]">
{error ? (
{loading ? (
<div className="flex h-[220px] items-center justify-center gap-2 px-4 text-center text-[#64748b]">
<Loader2 className="animate-spin" size={18} aria-hidden="true" />
<span className="text-[13px] font-bold">플랫폼 목록을 불러오는 중입니다.</span>
</div>
) : error ? (
<div className="flex h-[220px] items-center justify-center px-4 text-center">
<p className="text-[13px] font-bold text-[#64748b]">{error}</p>
</div>