Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] 대시보드 UI 수정, summary 여부에 따른 AI 요약 확인 버튼 분기 #378

Merged
merged 5 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 4 additions & 11 deletions apps/web/src/components/dashboard/AiSummaryDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,20 @@ function AiSummaryDialog({ isOpen, onClose, ticleId }: AiSummaryDialogProps) {
const { data } = useAiSummary(ticleId);

return (
<Dialog.Root isOpen={isOpen} onClose={onClose} className="h-[30rem] w-[35rem]">
<Dialog.Root isOpen={isOpen} onClose={onClose} className="flex h-[30rem] w-[35rem] flex-col">
<Dialog.Title align="center">AI 음성 요약</Dialog.Title>
<Dialog.Close onClose={onClose} />
<Dialog.Content className="custom-scrollbar overflow-y-scroll">
{!data && (
<Dialog.Content className="custom-scrollbar h-full overflow-y-scroll">
{!data?.summaryText && (
<div className="flex h-[20rem] w-full flex-col items-center justify-center gap-10">
<Loading color="primary" />
<span className="whitespace-pre text-center text-title1 text-primary">
AI 요약을 처리중이에요.
</span>
</div>
)}
{data && !data.summaryText && (
<div className="flex h-[20rem] w-full flex-col items-center justify-center gap-10">
<span className="whitespace-pre text-center text-title1 text-primary">
AI 요약 결과가 없어요.
</span>
</div>
)}
{data && data.summaryText && (
<p className="whitespace-pre text-body1">{data.summaryText}</p>
<p className="flex-1 whitespace-pre-wrap text-body1">{data.summaryText}</p>
)}
</Dialog.Content>
</Dialog.Root>
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/components/dashboard/apply/TicleInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ interface TicleInfoCardProps {
startTime: string;
endTime: string;
status: 'closed' | 'open' | 'inProgress';
isSummaryExist: boolean;
}

function TicleInfoCard({
Expand All @@ -24,6 +25,7 @@ function TicleInfoCard({
startTime,
endTime,
status,
isSummaryExist,
}: TicleInfoCardProps) {
const { isOpen, onOpen, onClose } = useModal();
const { dateStr, timeRangeStr } = formatDateTimeRange(startTime, endTime);
Expand Down Expand Up @@ -59,7 +61,7 @@ function TicleInfoCard({
</div>
</div>
<div className="flex gap-9">
{status === 'closed' && (
{status === 'closed' && isSummaryExist && (
<button
className="flex items-center gap-2 rounded-md p-2.5 hover:bg-teritary"
onClick={handleAiSummaryDialogOpen}
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/components/dashboard/apply/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function Apply() {
startTime={ticle.startTime}
endTime={ticle.endTime}
status={ticle.ticleStatus}
isSummaryExist={ticle.summary}
/>
))}
</Fragment>
Expand Down
12 changes: 10 additions & 2 deletions apps/web/src/components/dashboard/open/TicleInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,17 @@ interface TicleInfoCardProps {
startTime: string;
endTime: string;
status: 'closed' | 'open' | 'inProgress';
isSummaryExist: boolean;
}

function TicleInfoCard({ ticleId, ticleTitle, startTime, endTime, status }: TicleInfoCardProps) {
function TicleInfoCard({
ticleId,
ticleTitle,
startTime,
endTime,
status,
isSummaryExist,
}: TicleInfoCardProps) {
const {
isOpen: isApplicantsDialogOpen,
onOpen: onApplicantsDialogOpen,
Expand Down Expand Up @@ -72,7 +80,7 @@ function TicleInfoCard({ ticleId, ticleTitle, startTime, endTime, status }: Ticl
</div>
</div>
<div className="flex gap-9">
{status === 'closed' && (
{status === 'closed' && isSummaryExist && (
<button
className="flex items-center gap-2 rounded-md p-2.5 hover:bg-teritary"
onClick={handleAiSummaryDialogOpen}
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/components/dashboard/open/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function Open() {
startTime={ticle.startTime}
endTime={ticle.endTime}
status={ticle.ticleStatus}
isSummaryExist={ticle.summary}
/>
))}
</Fragment>
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/dashboard/getDashboardList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const BaseDashboardResponseSchema = z.object({
startTime: z.string().datetime(),
endTime: z.string().datetime(),
ticleStatus: z.enum([TicleStatus.CLOSED, TicleStatus.OPEN, TicleStatus.IN_PROGRESS]),
summary: z.boolean(),
});

const AppliedTicleSchema = BaseDashboardResponseSchema.extend({
Expand Down
Loading