diff --git a/src/components/page/researchDetail/ResearchDetail.tsx b/src/components/page/researchDetail/ResearchDetail.tsx index 74bebd7..e4d8e94 100644 --- a/src/components/page/researchDetail/ResearchDetail.tsx +++ b/src/components/page/researchDetail/ResearchDetail.tsx @@ -60,6 +60,23 @@ export const ResearchDetail: FC = ({ return `${publication.firstPage}-${publication.lastPage}`; }, [publication.firstPage, publication.lastPage]); + const quotation = useMemo(() => { + const authorsString = authors.map((author) => `${author.familyName.ja}${author.givenName.ja}`).join(", "); + const year = new Date(publishDateStr).getFullYear(); + + const parts = [ + `${authorsString}.`, + title, + journalTitle ? `${journalTitle},` : null, + publication.volume ? `Vol.${publication.volume},` : null, + publication.issue ? `No.${publication.issue},` : null, + pages ? `pp.${pages},` : null, + `${year}.`, + ].filter(Boolean); + + return parts.join(" "); + }, [authors, title, journalTitle, publication.volume, publication.issue, pages, publishDateStr]); + return (
{hero && } @@ -117,7 +134,7 @@ export const ResearchDetail: FC = ({ ref={citeTextareaRef} className={"h-full w-full resize-none border-0 bg-transparent"} readOnly - value={`${authors.map((author) => `${author.familyName.ja}${author.givenName.ja}`).join(", ")}. ${title}, ${journalTitle}, Vol.${publication.volume}, No.${publication.issue}, pp.${pages}, ${new Date(publishDateStr).getFullYear()}.`} + value={quotation} />