Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/app/(page)/disputes/[id]/DisputePage.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@
padding-bottom: fn.r(80);
}

.contentType {
flex: 1;
overflow-y: auto;
}

.contentWithFooter {
flex: 1;
overflow-y: auto;
Expand Down
2 changes: 1 addition & 1 deletion src/app/(page)/disputes/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export default function DisputePage({ params }: { params: Promise<{ id: string }
{isCompleted && <Tabs tabs={TABS} activeId={activeTab} onChange={setActiveTab} />}

{/* 컨텐츠 */}
<div className={isCompleted ? styles.content : styles.contentWithFooter}>
<div className={!isCompleted ? styles.contentWithFooter : judgmentSubTab === 'type' ? styles.contentType : styles.content}>
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
{(!isCompleted || activeTab === 'statement') && (
<div className={styles.statements}>
{roleAStatement && (
Expand Down
13 changes: 9 additions & 4 deletions src/app/(page)/disputes/[id]/type/ConflictTypeClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from 'react'
import Image from 'next/image'
import { useRouter } from 'next/navigation'
import { useSession } from 'next-auth/react'
import Header from '@/components/layout/Header'
import Button from '@/components/ui/Button'
import type { ConflictTypePublicDto } from '@/app/api/disputes/[id]/conflict-type/route'
import styles from './TypePage.module.scss'
Expand Down Expand Up @@ -51,12 +52,16 @@ export default function ConflictTypeClient({ data }: Props) {

return (
<div className={styles.page}>
<div className={styles.logoWrap}>
<Image src="/images/common/logo.svg" alt="TALKY OWL" width={120} height={32} />
</div>
<Header variant="logo" />

<div className={styles.content}>
<p className={styles.title}>{userName ? `${userName}님의 갈등 유형은?` : '나의 갈등 유형은?'}</p>
<p className={styles.title}>
{userName
? `${userName}님의 갈등 유형은?`
: data.ownerName
? `${data.ownerName}님의 갈등 유형은?`
: '나의 갈등 유형은?'}
</p>

<div className={styles.cardImageWrapper}>
{data.cardImageUrl ? (
Expand Down
11 changes: 3 additions & 8 deletions src/app/(page)/disputes/[id]/type/TypePage.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
.page {
display: flex;
flex-direction: column;
min-height: 100dvh;
padding: fn.r(24) fn.r(16) fn.r(32);
padding-bottom: fn.r(32);
background-color: v.$color-white;
}

Expand Down Expand Up @@ -36,17 +35,12 @@
color: v.$color-black-400;
}

.logoWrap {
display: flex;
justify-content: center;
margin-bottom: fn.r(32);
}

.content {
display: flex;
flex-direction: column;
gap: fn.r(16);
flex: 1;
padding: fn.r(24) fn.r(16) 0;
}

.title {
Expand Down Expand Up @@ -95,6 +89,7 @@

.actions {
margin-top: fn.r(24);
padding: 0 fn.r(16);
display: flex;
flex-direction: column;
gap: fn.r(12);
Expand Down
8 changes: 7 additions & 1 deletion src/app/(page)/disputes/[id]/type/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ async function getConflictType(id: string): Promise<ConflictTypePublicDto | null
},
},
},
participants: {
where: { role: 'ROLE_A' },
select: { user: { select: { name: true } } },
take: 1,
},
},
})

if (!dispute?.aiJudgment?.resultConflictDetail) return null
const { displayName, description, card_image_url } = dispute.aiJudgment.resultConflictDetail
return { displayName, description, cardImageUrl: card_image_url }
const ownerName = dispute.participants[0]?.user.name ?? null
return { displayName, description, cardImageUrl: card_image_url, ownerName }
}

export async function generateMetadata({ params }: Props): Promise<Metadata> {
Expand Down
9 changes: 8 additions & 1 deletion src/app/api/disputes/[id]/conflict-type/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface ConflictTypePublicDto {
displayName: string
description: string | null
cardImageUrl: string | null
ownerName: string | null
}

// GET /api/disputes/:id/conflict-type
Expand Down Expand Up @@ -35,6 +36,11 @@ export async function GET(
},
},
},
participants: {
where: { role: 'ROLE_A' },
select: { user: { select: { name: true } } },
take: 1,
},
},
})

Expand All @@ -46,10 +52,11 @@ export async function GET(
}

const { displayName, description, card_image_url } = dispute.aiJudgment.resultConflictDetail
const ownerName = dispute.participants[0]?.user.name ?? null

return NextResponse.json<ApiResponse<ConflictTypePublicDto>>({
success: true,
data: { displayName, description, cardImageUrl: card_image_url },
data: { displayName, description, cardImageUrl: card_image_url, ownerName },
})
} catch (error) {
console.error('[GET /api/disputes/:id/conflict-type] failed', { disputeId: id, error })
Expand Down