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 (