diff --git a/src/app/(main)/analysis/[id]/[patentId]/page.tsx b/src/app/(main)/analysis/[id]/[patentId]/page.tsx index 7f25760..1524823 100644 --- a/src/app/(main)/analysis/[id]/[patentId]/page.tsx +++ b/src/app/(main)/analysis/[id]/[patentId]/page.tsx @@ -22,7 +22,6 @@ import type { function renderArgumentForm( analysis: InventiveStepAnalysisResponse, logicKey: InventiveStepLogicKey, - contentIsPlaceholder: boolean, onSave: (argumentId: number, content: InventiveStepArgumentContent) => Promise ) { const argument = getArgument(analysis, logicKey); @@ -32,7 +31,6 @@ function renderArgumentForm( case "NUMERICAL_LIMIT": return ( onSave(argument.argumentId, { effect_items: effectItems, @@ -52,7 +50,6 @@ function renderArgumentForm( onSave(argument.argumentId, content)} /> ); @@ -65,7 +62,6 @@ function renderArgumentForm( onSave(argument.argumentId, content)} /> ); @@ -82,7 +78,6 @@ function renderArgumentForm( onSave(argument.argumentId, content)} /> ); @@ -103,9 +98,6 @@ export default function AnalysisReportPage({ isLoading, selectedLogics, aiRecommendedArgumentIds, - placeholderArgumentIds, - updatingLogics, - updateError, toggleLogic, saveArgumentContent, reload, @@ -172,18 +164,11 @@ export default function AnalysisReportPage({ getArgument(analysis, logic.key)?.argumentId ?? Number.NaN )} selected={selectedLogics.has(logic.key)} - disabled={updatingLogics.has(logic.key)} onClick={() => toggleLogic(logic.key)} /> ))} - {updateError && ( -

- {updateError} -

- )} -
{selectedLogics.size === 0 ? (

@@ -193,14 +178,7 @@ export default function AnalysisReportPage({ INVENTIVE_STEP_LOGIC_TYPES.filter((logic) => selectedLogics.has(logic.key)).map( (logic) => (

- {renderArgumentForm( - analysis, - logic.key, - placeholderArgumentIds.has( - getArgument(analysis, logic.key)?.argumentId ?? Number.NaN - ), - saveArgumentContent - )} + {renderArgumentForm(analysis, logic.key, saveArgumentContent)}
) ) diff --git a/src/app/(report)/myhistory/[id]/report/page.tsx b/src/app/(report)/myhistory/[id]/report/page.tsx index b18a6c1..d9fe7d6 100644 --- a/src/app/(report)/myhistory/[id]/report/page.tsx +++ b/src/app/(report)/myhistory/[id]/report/page.tsx @@ -57,6 +57,14 @@ function getArgument(report: ReportDetailResponse, argumentType: ReportInventive ); } +function hasContent(content: Record) { + return Object.values(content).some((value) => { + if (Array.isArray(value)) return value.length > 0; + if (typeof value === "string") return value.trim().length > 0; + return value !== null && value !== undefined; + }); +} + export default function ReportPage({ params }: { params: Promise<{ id: string }> }) { const { id } = use(params); const { isAuthenticated, report, errorMessage, isLoading, reload } = useReport(id); @@ -84,14 +92,15 @@ export default function ReportPage({ params }: { params: Promise<{ id: string }> ); } - const numericalContent = - getArgument(report, "NUMERICAL_LIMIT")?.content ?? ({} as Record); - const combinationContent = - getArgument(report, "COMBINATION_MOTIVATION")?.content ?? ({} as Record); - const commonContent = - getArgument(report, "COMMON_TECHNIQUE")?.content ?? ({} as Record); - const simpleContent = - getArgument(report, "SIMPLE_DESIGN")?.content ?? ({} as Record); + const numericalArgument = getArgument(report, "NUMERICAL_LIMIT"); + const combinationArgument = getArgument(report, "COMBINATION_MOTIVATION"); + const commonArgument = getArgument(report, "COMMON_TECHNIQUE"); + const simpleArgument = getArgument(report, "SIMPLE_DESIGN"); + + const numericalContent = numericalArgument?.content ?? ({} as Record); + const combinationContent = combinationArgument?.content ?? ({} as Record); + const commonContent = commonArgument?.content ?? ({} as Record); + const simpleContent = simpleArgument?.content ?? ({} as Record); const effectItems = Array.isArray(numericalContent.effect_items) ? (numericalContent.effect_items as EffectItem[]) : []; @@ -148,6 +157,10 @@ export default function ReportPage({ params }: { params: Promise<{ id: string }> ? toReference(report.inventiveStepAnalysis.secondaryPriorArt) : null } + showNumericalLimits={hasContent(numericalContent)} + showCombinationMotivation={hasContent(combinationContent)} + showCommonTechnique={hasContent(commonContent)} + showSimpleDesign={hasContent(simpleContent)} numericalLimits={effectItems.map((effect, index) => ({ id: String(index + 1), category: text(effect.metric), diff --git a/src/app/fonts.ts b/src/app/fonts.ts new file mode 100644 index 0000000..1692933 --- /dev/null +++ b/src/app/fonts.ts @@ -0,0 +1,8 @@ +import localFont from "next/font/local"; + +export const pretendard = localFont({ + src: "./fonts/PretendardVariable.woff2", + weight: "45 920", + variable: "--font-pretendard-loaded", + display: "swap", +}); diff --git a/src/app/fonts/PretendardVariable.woff2 b/src/app/fonts/PretendardVariable.woff2 new file mode 100644 index 0000000..49c54b5 Binary files /dev/null and b/src/app/fonts/PretendardVariable.woff2 differ diff --git a/src/app/globals.css b/src/app/globals.css index a2bcb9b..e4ec4aa 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,4 +1,3 @@ -@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css"); @import "tailwindcss"; :root { @@ -9,7 +8,7 @@ @theme inline { --color-background: var(--background); --color-foreground: var(--foreground); - --font-pretendard: "Pretendard", sans-serif; + --font-pretendard: var(--font-pretendard-loaded), sans-serif; /* ========================================= Text Color diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 2d05748..87886ec 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -2,6 +2,7 @@ import type { Metadata } from "next"; import { jsonLd, siteConfig } from "@/constants/common/site"; import { Providers } from "@/app/providers"; +import { pretendard } from "@/app/fonts"; import "./globals.css"; @@ -70,7 +71,7 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - +