This commit is contained in:
dahyeon committed 2026-05-03 02:45:52 -07:00
1 parent cf887b3acc
commit 6767a9f61b
14 files changed
+749 -21

No files matched your search

+7
View File
@@ -199,6 +199,12 @@ export interface ApiMatchScheduleItem {
label: string;
}
export interface ApiMatchGameAssignment {
gameNumber: number;
teamAIndex: number;
teamBIndex: number;
}
export interface ApiMatch {
_id: string;
communityId: string;
@@ -211,6 +217,7 @@ export interface ApiMatch {
maxParticipants: number;
gameCount: number;
gameMode: MatchGameMode;
gameSchedule?: ApiMatchGameAssignment[];
tournamentCodes?: TournamentCodeSlotView[];
hostUserId?: string;
participants: ApiMatchParticipant[];
+20 -2
View File
@@ -35,6 +35,14 @@ const GAME_MODE_LABEL: Record<MatchGameMode, string> = {
'round-robin': '라운드 로빈',
};
function RequiredBadge() {
return (
<span className="ml-1 inline-flex items-center border border-primary/20 bg-primary/5 px-1.5 py-0.5 text-[10px] font-bold text-primary">
필수
</span>
);
}
function toInputValue(value: string | Date) {
const date = value instanceof Date ? value : new Date(value);
const offset = date.getTimezoneOffset();
@@ -169,11 +177,16 @@ export default function MatchAdminPage() {
function submit() {
setMessage(null);
const payload = buildPayload();
if (!payload.title) {
if (!form.title.trim()) {
setMessage('제목을 입력해주세요.');
return;
}
if (!form.scheduledAt) {
setMessage('시작 시간을 입력해주세요.');
return;
}
const payload = buildPayload();
const callbacks = {
onSuccess: async () => {
@@ -244,7 +257,9 @@ export default function MatchAdminPage() {
<div className="grid md:grid-cols-2 gap-3">
<label className="text-xs text-base-content/45 md:col-span-2">
제목
<RequiredBadge />
<input
required
value={form.title}
onChange={(event) => setForm((current) => ({ ...current, title: event.target.value }))}
className="mt-1 w-full border border-base-content/10 bg-transparent px-3 py-2 text-sm"
@@ -252,6 +267,7 @@ export default function MatchAdminPage() {
</label>
<label className="text-xs text-base-content/45 md:col-span-2">
설명
<span className="ml-1 text-[10px] text-base-content/25">선택</span>
<textarea
value={form.description}
onChange={(event) => setForm((current) => ({ ...current, description: event.target.value }))}
@@ -261,7 +277,9 @@ export default function MatchAdminPage() {
</label>
<label className="text-xs text-base-content/45">
시작 시간
<RequiredBadge />
<input
required
type="datetime-local"
value={form.scheduledAt}
onChange={(event) => setForm((current) => ({ ...current, scheduledAt: event.target.value }))}