);
diff --git a/src/app/members/layout.tsx b/src/app/members/layout.tsx
index ea32f90..9d85e69 100644
--- a/src/app/members/layout.tsx
+++ b/src/app/members/layout.tsx
@@ -11,7 +11,7 @@ export default function Layout({
children: React.ReactNode;
}>) {
return (
-
+
{children}
);
diff --git a/src/app/my-account/layout.tsx b/src/app/my-account/layout.tsx
index bc71184..7170077 100644
--- a/src/app/my-account/layout.tsx
+++ b/src/app/my-account/layout.tsx
@@ -10,9 +10,5 @@ export default function Layout({
}: Readonly<{
children: React.ReactNode;
}>) {
- return (
-
- {children}
-
- );
+ return
{children}
;
}
diff --git a/src/app/portfolio/layout.tsx b/src/app/portfolio/layout.tsx
index d131995..d6104e4 100644
--- a/src/app/portfolio/layout.tsx
+++ b/src/app/portfolio/layout.tsx
@@ -10,9 +10,5 @@ export default function Layout({
}: Readonly<{
children: React.ReactNode;
}>) {
- return (
-
- {children}
-
- );
+ return
{children}
;
}
diff --git a/src/app/search/[id]/_components/detail-info/company-overview/consensus.tsx b/src/app/search/[id]/_components/detail-info/company-overview/consensus.tsx
new file mode 100644
index 0000000..a9a7fb0
--- /dev/null
+++ b/src/app/search/[id]/_components/detail-info/company-overview/consensus.tsx
@@ -0,0 +1,29 @@
+export default function Consensus() {
+ return (
+
+ );
+}
diff --git a/src/app/search/[id]/_components/detail-info/company-overview/financial-statements.tsx b/src/app/search/[id]/_components/detail-info/company-overview/financial-statements.tsx
new file mode 100644
index 0000000..430a0ba
--- /dev/null
+++ b/src/app/search/[id]/_components/detail-info/company-overview/financial-statements.tsx
@@ -0,0 +1,138 @@
+"use client";
+
+type FinancialRatio = {
+ stockAccountingYearMonth: string;
+ grossMarginRatio: number;
+ businessProfitRate: number;
+ netInterestRate: number;
+ roeValue: number;
+ earningsPerShare: number;
+ salesPerShare: number;
+ bookValuePerShare: number;
+ reserveRate: number;
+ liabilityRate: number;
+};
+
+type NumberKeys = {
+ [K in keyof FinancialRatio]: FinancialRatio[K] extends number ? K : never;
+}[keyof FinancialRatio];
+
+type FinancialMetric = {
+ label: string;
+ key: NumberKeys;
+ isPercentage?: boolean;
+};
+
+const FINANCIAL_METRICS: FinancialMetric[] = [
+ { label: "총마진율", key: "grossMarginRatio", isPercentage: true },
+ { label: "사업 수익률", key: "businessProfitRate", isPercentage: true },
+ { label: "순이자율", key: "netInterestRate", isPercentage: true },
+ { label: "ROE", key: "roeValue", isPercentage: true },
+ { label: "EPS(주당순이익)", key: "earningsPerShare" },
+ { label: "SPS(주당매출액)", key: "salesPerShare" },
+ { label: "BPS(주당순자산)", key: "bookValuePerShare" },
+ { label: "주식유보율", key: "reserveRate", isPercentage: true },
+ { label: "부채율", key: "liabilityRate", isPercentage: true },
+];
+
+const formatValue = (value: number | null, isPercentage?: boolean) => {
+ if (value === null) return "-";
+ const formattedNumber = value.toLocaleString();
+ return isPercentage ? `${formattedNumber}%` : formattedNumber;
+};
+
+function TableHeader({ years }: { years: string[] }) {
+ return (
+
+
+ |
+ 주요재무정보
+ |
+
+ 연간
+ |
+
+
+ {years.map((year) => (
+ |
+ {year}
+ |
+ ))}
+
+
+ );
+}
+
+function TableRow({
+ label,
+ values,
+ isPercentage,
+}: {
+ label: string;
+ values: (number | null)[];
+ isPercentage?: boolean;
+}) {
+ return (
+
+ |
+ {label}
+ |
+ {values.map((value, index) => (
+
+ {formatValue(value, isPercentage)}
+ |
+ ))}
+
+ );
+}
+
+function NoDataMessage() {
+ return (
+
+ 데이터가 없습니다.
+
+ );
+}
+
+interface FinancialStatementsProps {
+ data?: FinancialRatio[];
+}
+
+export default function FinancialStatements({
+ data,
+}: FinancialStatementsProps) {
+ if (!data || data.length === 0) {
+ return
;
+ }
+
+ const years = data.map((item) => item.stockAccountingYearMonth);
+
+ return (
+
+ 재무비율
+
+
+ {FINANCIAL_METRICS.map((metric) => (
+
+ item[metric.key] !== undefined ? Number(item[metric.key]) : null,
+ )}
+ isPercentage={metric.isPercentage}
+ />
+ ))}
+
+
+ );
+}
diff --git a/src/app/search/[id]/_components/detail-info/company-overview/index.tsx b/src/app/search/[id]/_components/detail-info/company-overview/index.tsx
new file mode 100644
index 0000000..99dac62
--- /dev/null
+++ b/src/app/search/[id]/_components/detail-info/company-overview/index.tsx
@@ -0,0 +1,29 @@
+"use client";
+
+import Consensus from "./consensus";
+import FinancialStatements from "./financial-statements";
+import TargetPrice from "./target-price";
+
+export default function CompanyOverview() {
+ return (
+
+
+
기업정보
+
[기준: 2024. 08. 16]
+
+
+ - 한국 및 DX 부문 해외 9개
+ - 한국 및 DX 부문 해외 9개
+ - 한국 및 DX 부문 해외 9개
+
+
+
+
+
+
+ 전 세계 1200개 리서치 회사의 정보를 종합적으로 분석합니다.
+ 기준 2024.08.29 . 레피니티브 제공
+
+
+ );
+}
diff --git a/src/app/search/[id]/_components/detail-info/company-overview/target-price.tsx b/src/app/search/[id]/_components/detail-info/company-overview/target-price.tsx
new file mode 100644
index 0000000..1c51564
--- /dev/null
+++ b/src/app/search/[id]/_components/detail-info/company-overview/target-price.tsx
@@ -0,0 +1,17 @@
+export default function TargetPrice() {
+ return (
+
+
목표주가
+
+
43.90
+
+
목표가범위
+
26.00~60.00
+
+
+
+
+
+
+ );
+}
diff --git a/src/app/search/[id]/_components/detail-info/index.tsx b/src/app/search/[id]/_components/detail-info/index.tsx
new file mode 100644
index 0000000..43ab2a8
--- /dev/null
+++ b/src/app/search/[id]/_components/detail-info/index.tsx
@@ -0,0 +1,31 @@
+"use client";
+
+import {
+ Tabs,
+ TabsContent,
+ TabsList,
+ TabsTrigger,
+} from "@/components/common/tabs";
+
+import CompanyOverview from "./company-overview";
+import RelativeNews from "./relative-news";
+
+export default function DetailInfo() {
+ return (
+
+
상세 정보
+
+
+ 기업 개요
+ 관련 뉴스
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/src/app/search/[id]/_components/detail-info/relative-news/index.tsx b/src/app/search/[id]/_components/detail-info/relative-news/index.tsx
new file mode 100644
index 0000000..9fd8132
--- /dev/null
+++ b/src/app/search/[id]/_components/detail-info/relative-news/index.tsx
@@ -0,0 +1,26 @@
+"use client";
+
+export default function RelativeNews() {
+ return (
+
+ 관련뉴스
+
+
+ | 제목 |
+ 정보 제공 |
+ 날짜 |
+
+
+
+
+ |
+ 코스피, 외국인 "바이 코리아"에 2680 선 마감.. LG 에너지
+ 솔루
+ |
+ 머니 투데이 |
+ 2024.09.02 |
+
+
+
+ );
+}
diff --git a/src/app/search/[id]/layout.tsx b/src/app/search/[id]/layout.tsx
index a3df806..13ac983 100644
--- a/src/app/search/[id]/layout.tsx
+++ b/src/app/search/[id]/layout.tsx
@@ -10,9 +10,5 @@ export default function Layout({
}: Readonly<{
children: React.ReactNode;
}>) {
- return (
-
- {children}
-
- );
+ return
{children}
;
}
diff --git a/src/app/search/[id]/page.tsx b/src/app/search/[id]/page.tsx
index ea14aa3..a0c79f6 100644
--- a/src/app/search/[id]/page.tsx
+++ b/src/app/search/[id]/page.tsx
@@ -1,6 +1,7 @@
import Link from "next/link";
import CandlestickChartContainer from "./_components/candle-chart-container";
+import DetailInfo from "./_components/detail-info";
import OrderStock from "./_components/order-stock";
import StockHeader from "./_components/stock-header";
import TutorialContainer from "./_components/tutorial/tutorial-container";
@@ -74,6 +75,7 @@ export default async function StockPage({