From ef4418bf845dfe1d09b030aeb919e0ffec39f152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=82=98=ED=98=95=EC=A7=84?= Date: Tue, 19 Aug 2025 15:40:13 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20decompose=20query=20panel=20&=20add=20b?= =?UTF-8?q?utton=20'=EC=8B=A4=ED=96=89=ED=95=98=EA=B8=B0'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workspace/query-panel/query-editor.tsx | 17 +-- .../workspace/query-panel/query-panel.tsx | 83 ++++++++++-- .../workspace/query-panel/query-results.tsx | 126 ++++++++++++------ 3 files changed, 166 insertions(+), 60 deletions(-) diff --git a/src/renderer/src/components/workspace/query-panel/query-editor.tsx b/src/renderer/src/components/workspace/query-panel/query-editor.tsx index 07ce5ee..a20a343 100644 --- a/src/renderer/src/components/workspace/query-panel/query-editor.tsx +++ b/src/renderer/src/components/workspace/query-panel/query-editor.tsx @@ -1,21 +1,14 @@ -import { useState } from 'react' +interface QueryEditorProps { + query: string + setQuery: (query: string) => void +} /** * @author nahyeongjin1 * @summary 쿼리 편집기 패널 * @returns JSX.Element */ -export default function QueryEditor(): React.JSX.Element { - const [query, setQuery] = useState( - 'SELECT p.ProductName, SUM(sod.sales_quantity) as total_quantity_sold, ' + - 'SUM(sod.sales_quantity * sod.UnitPrice) as total_revenue ' + - 'FROM Products p ' + - 'JOIN SalesOrderDetails sod ON p.ProductID = sod.ProductID ' + - 'GROUP BY p.ProductID, p.ProductName ' + - 'ORDER BY total_revenue DESC ' + - 'LIMIT 5;' - ) - +export default function QueryEditor({ query, setQuery }: QueryEditorProps): React.JSX.Element { return (