Skip to content

Commit

Permalink
~9차 스프린트 작업사항 #4 (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
junhea authored Nov 21, 2023
2 parents ee486c5 + 1009f1b commit d852b96
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,20 @@
max-width: 500px;
width: 100%;
}
.notice {
box-sizing: border-box;
margin: 5px;
gap: 10px;
padding: 5px 20px;
display: flex;
border-radius: 20px;
align-items: center;
border: 2px solid var(--warning-color);
color: var(--warning-color) !important;
animation: var(--intro-animation);
}

.noticeText {
padding: 0;
margin: 0;
}
18 changes: 16 additions & 2 deletions app/components/DocumentCreateDialogue/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,25 @@ export default function DocumentCreateDialogue({
<TextInput label="제목" name="title" />
<FileInput
name="file"
types={['application/pdf', 'audio/mpeg']}
typeNames={['pdf(최대 30페이지)', 'mp3']}
types={['application/pdf']}
typeNames={['pdf(최대 30페이지)']}
onError={(msg) => pushToast({ id: new Date().getTime(), duraton: 3000, msg: msg })}
/>
<Notice text="STT 오류로 인해 mp3 파일 업로드가 일시적으로 제한됩니다." />
</Dialogue>
</div>
);
}

interface NoticeProps {
text: string;
}

function Notice({ text }: NoticeProps) {
return (
<div className={styles.notice}>
<span className="material-symbols-outlined">warning</span>
<p className={styles.noticeText}>{text}</p>
</div>
);
}
2 changes: 1 addition & 1 deletion global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,4 @@ interface KeywordResponse {
text: string;
}

type ViewerEventType = 'mindmap' | 'answer' | 'audio' | 'keywords' | 'sse';
type ViewerEventType = 'mindmap' | 'answer' | 'audio' | 'keywords' | 'sse' | 'ping';
2 changes: 1 addition & 1 deletion utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function createDocumentEventSource(documentId?: number) {
headers.Authorization = newAccessToken;
});

const eventTypes: ViewerEventType[] = ['answer', 'audio', 'keywords', 'mindmap', 'sse'];
const eventTypes: ViewerEventType[] = ['answer', 'audio', 'keywords', 'mindmap', 'sse', 'ping'];
for (const type of eventTypes) {
eventSource.addEventListener(type, (e) => {
console.log(type, e);
Expand Down

0 comments on commit d852b96

Please sign in to comment.