Skip to content

Commit

Permalink
feat: 첨부파일 다운로드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
xxxjinn committed Aug 15, 2024
1 parent a523205 commit 6232c5c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/features/content/ui/CommonDetailComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { formatDate } from '@/shared/lib/utils';
import BackToListButton from '@/features/content/ui/BackToListButton';
import ReactMarkdown from 'react-markdown';
import rehypeRaw from 'rehype-raw';
import { TbDownload } from 'react-icons/tb';

const CommonDetailComponent = ({
content: data,
Expand Down Expand Up @@ -33,6 +34,18 @@ const CommonDetailComponent = ({
{data.content}
</ReactMarkdown>
</div>
<hr />
{data.urlList.length > 0 &&
data.urlList.map(() => (
<a
className="flex flex-row items-center gap-1 pt-2 text-sm"
href={data.urlList[0]}
download="다운로드 되는 파일명"
>
<TbDownload size={16} />
첨부파일 다운로드
</a>
))}
<div className="flex justify-end">
<BackToListButton />
</div>
Expand Down

0 comments on commit 6232c5c

Please sign in to comment.