From 707835be36103edbcaf8c93967da76545ed01469 Mon Sep 17 00:00:00 2001 From: da1907 Date: Tue, 15 Dec 2020 02:44:49 +0900 Subject: [PATCH 1/6] =?UTF-8?q?docs:=20=EA=B5=AC=ED=98=84=ED=95=A0=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EB=AA=A9=EB=A1=9D=20=EC=97=85=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 docs/README.md diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000..25312e948 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,35 @@ +## ๐Ÿ“Œ ๊ตฌํ˜„ํ•  ๊ธฐ๋Šฅ ๋ชฉ๋ก + +- ๋ฉ”๋‰ด ๊ธฐ๋Šฅ + [ ] ๋ฉ”๋‰ด ๋ฒ„ํŠผ ์ƒ์„ฑ + [ ] `1. ์—ญ ๊ด€๋ฆฌ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **์ง€ํ•˜์ฒ  ์—ญ ๊ด€๋ จ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ + [ ] `2. ๋…ธ์„  ๊ด€๋ฆฌ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **์ง€ํ•˜์ฒ  ๋…ธ์„  ๊ด€๋ จ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ + [ ] `3. ๊ตฌ๊ฐ„ ๊ด€๋ฆฌ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **์ง€ํ•˜์ฒ  ๊ตฌ๊ฐ„ ๊ด€๋ จ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ + [ ] `4. ์ง€ํ•˜์ฒ  ๋…ธ์„ ๋„ ์ถœ๋ ฅ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **๋ชจ๋“  ๋…ธ์„ ์˜ ์—ญ ์กฐํšŒ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ + +- ์ง€ํ•˜์ฒ  ์—ญ ๊ด€๋ จ ๊ธฐ๋Šฅ + [ ] UI ๊ตฌํ˜„ + [ ] ์ง€ํ•˜์ฒ  ์—ญ ๋“ฑ๋ก + [ ] ์—ญ ์ด๋ฆ„ ์ค‘๋ณต ์—ฌ๋ถ€ ์ฒดํฌ + [ ] ์—ญ ์ด๋ฆ„ ๋‘ ๊ธ€์ž ์ด์ƒ์ธ์ง€ ์ฒดํฌ + [ ] ์—ญ ๋ชฉ๋ก์— ์ถ”๊ฐ€ + [ ] ์ง€ํ•˜์ฒ  ์—ญ ์‚ญ์ œ + [ ] ๋…ธ์„ ์— ๋“ฑ๋ก๋˜์–ด ์žˆ๋Š” ์—ญ์ธ์ง€ ์ฒดํฌ + +- ์ง€ํ•˜์ฒ  ๋…ธ์„  ๊ด€๋ จ ๊ธฐ๋Šฅ + [ ] UI ๊ตฌํ˜„ + [ ] ๋…ธ์„  ์ด๋ฆ„, ์ƒํ–‰ ์ข…์ ์—ญ, ํ•˜ํ–‰ ์ข…์ ์—ญ ์ž…๋ ฅ๋ฐ›๊ธฐ + [ ] ๋…ธ์„  ์ด๋ฆ„ ์ค‘๋ณต ์—ฌ๋ถ€ ์ฒดํฌ + [ ] ๋…ธ์„  ๋ชฉ๋ก์— ์ถ”๊ฐ€ + [ ] ๋…ธ์„  ์‚ญ์ œ + +- ์ง€ํ•˜์ฒ  ๊ตฌ๊ฐ„ ๊ด€๋ จ ๊ธฐ๋Šฅ + [ ] UI ๊ตฌํ˜„ + [ ] ์ˆ˜์ •ํ•  ๋…ธ์„  ์ž…๋ ฅ๋ฐ›๊ธฐ + [ ] ๊ตฌ๊ฐ„ ๋“ฑ๋ก + [ ] ์ œ์ผ ์ฒ˜์Œ, ์ œ์ผ ๋์— ์ถ”๊ฐ€๋˜๋ฉด alert + [ ] ๊ตฌ๊ฐ„ ์‚ญ์ œ + [ ] ์‚ญ์ œํ•˜๊ณ  ๋‚จ์€ ์—ญ ๊ฐœ์ˆ˜ ๋‘ ๊ฐœ ์ดํ•˜์ด๋ฉด alert + +- ๋ชจ๋“  ๋…ธ์„ ์˜ ์—ญ ์กฐํšŒ ๊ธฐ๋Šฅ + [ ] ๋ชจ๋“  ๋…ธ์„ ์˜ ์—ญ ๋ชฉ๋ก ์ถœ๋ ฅ From 0b54f8ddd05898b2e7d17c77e834a8ec12c3dd40 Mon Sep 17 00:00:00 2001 From: da1907 Date: Tue, 15 Dec 2020 03:04:06 +0900 Subject: [PATCH 2/6] =?UTF-8?q?eslint,=20prettier=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.json | 17 +++++++++++++++++ .prettierrc.json | 6 ++++++ 2 files changed, 23 insertions(+) create mode 100644 .eslintrc.json create mode 100644 .prettierrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..a9ab309eb --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,17 @@ +{ + "env": { + "browser": true, + "es6": true + }, + "extends": "eslint:recommended", + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 2018, + "sourceType": "module" + }, + "rules": { + } +} \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 000000000..0a725205c --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "trailingComma": "es5", + "tabWidth": 2, + "semi": true, + "singleQuote": true +} From fa864e33d67bd5bae355c460abe2217a41f0a40d Mon Sep 17 00:00:00 2001 From: da1907 Date: Tue, 15 Dec 2020 03:04:26 +0900 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=EB=A9=94=EB=89=B4=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 2 +- index.html | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 25312e948..be53e18a9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,7 +1,7 @@ ## ๐Ÿ“Œ ๊ตฌํ˜„ํ•  ๊ธฐ๋Šฅ ๋ชฉ๋ก - ๋ฉ”๋‰ด ๊ธฐ๋Šฅ - [ ] ๋ฉ”๋‰ด ๋ฒ„ํŠผ ์ƒ์„ฑ + [x] ๋ฉ”๋‰ด ๋ฒ„ํŠผ ์ƒ์„ฑ [ ] `1. ์—ญ ๊ด€๋ฆฌ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **์ง€ํ•˜์ฒ  ์—ญ ๊ด€๋ จ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ [ ] `2. ๋…ธ์„  ๊ด€๋ฆฌ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **์ง€ํ•˜์ฒ  ๋…ธ์„  ๊ด€๋ จ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ [ ] `3. ๊ตฌ๊ฐ„ ๊ด€๋ฆฌ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **์ง€ํ•˜์ฒ  ๊ตฌ๊ฐ„ ๊ด€๋ จ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ diff --git a/index.html b/index.html index fc99deac2..7fd31b1da 100644 --- a/index.html +++ b/index.html @@ -7,6 +7,13 @@

๐Ÿš‡ ์ง€ํ•˜์ฒ  ๋…ธ์„ ๋„ ๊ด€๋ฆฌ

+
+ + + + +
+
From a00e6eb7ebc6049506039ae7c2118398a3e73b70 Mon Sep 17 00:00:00 2001 From: da1907 Date: Tue, 15 Dec 2020 03:05:35 +0900 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=EB=A9=94=EB=89=B4=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EB=88=8C=EB=A0=80=EC=9D=84=20=EB=95=8C=EC=9D=98=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 8 ++++---- src/index.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/docs/README.md b/docs/README.md index be53e18a9..6fa5ce6f7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,10 +2,10 @@ - ๋ฉ”๋‰ด ๊ธฐ๋Šฅ [x] ๋ฉ”๋‰ด ๋ฒ„ํŠผ ์ƒ์„ฑ - [ ] `1. ์—ญ ๊ด€๋ฆฌ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **์ง€ํ•˜์ฒ  ์—ญ ๊ด€๋ จ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ - [ ] `2. ๋…ธ์„  ๊ด€๋ฆฌ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **์ง€ํ•˜์ฒ  ๋…ธ์„  ๊ด€๋ จ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ - [ ] `3. ๊ตฌ๊ฐ„ ๊ด€๋ฆฌ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **์ง€ํ•˜์ฒ  ๊ตฌ๊ฐ„ ๊ด€๋ จ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ - [ ] `4. ์ง€ํ•˜์ฒ  ๋…ธ์„ ๋„ ์ถœ๋ ฅ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **๋ชจ๋“  ๋…ธ์„ ์˜ ์—ญ ์กฐํšŒ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ + [x] `1. ์—ญ ๊ด€๋ฆฌ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **์ง€ํ•˜์ฒ  ์—ญ ๊ด€๋ จ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ + [x] `2. ๋…ธ์„  ๊ด€๋ฆฌ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **์ง€ํ•˜์ฒ  ๋…ธ์„  ๊ด€๋ จ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ + [x] `3. ๊ตฌ๊ฐ„ ๊ด€๋ฆฌ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **์ง€ํ•˜์ฒ  ๊ตฌ๊ฐ„ ๊ด€๋ จ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ + [x] `4. ์ง€ํ•˜์ฒ  ๋…ธ์„ ๋„ ์ถœ๋ ฅ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **๋ชจ๋“  ๋…ธ์„ ์˜ ์—ญ ์กฐํšŒ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ - ์ง€ํ•˜์ฒ  ์—ญ ๊ด€๋ จ ๊ธฐ๋Šฅ [ ] UI ๊ตฌํ˜„ diff --git a/src/index.js b/src/index.js index e69de29bb..fd84046ed 100644 --- a/src/index.js +++ b/src/index.js @@ -0,0 +1,30 @@ +import { applyStation } from './station.js'; +import { applyLine } from './line.js'; +import { applySection } from './section.js'; +import { printMap } from './mapPrint.js'; + +export default function SubwayMap() { + const stationManageBtn = document.getElementById('station-manager-button'); + const lineManageBtn = document.getElementById('line-manager-button'); + const sectionManageBtn = document.getElementById('section-manager-button'); + const mapPrintManageBtn = document.getElementById('map-print-manager-button'); + + const chooseMenu = () => { + if (stationManageBtn) { + stationManageBtn.addEventListener('click', applyStation); + } + if (lineManageBtn) { + lineManageBtn.addEventListener('click', applyLine); + } + if (sectionManageBtn) { + sectionManageBtn.addEventListener('click', applySection); + } + if (mapPrintManageBtn) { + mapPrintManageBtn.addEventListener('click', printMap); + } + }; + + chooseMenu(); +} + +new SubwayMap(); From ef788cf162e72163982f510daedd89c042ba2c16 Mon Sep 17 00:00:00 2001 From: da1907 Date: Tue, 15 Dec 2020 04:59:35 +0900 Subject: [PATCH 5/6] =?UTF-8?q?feat:=20alert=20=EB=A9=94=EC=84=B8=EC=A7=80?= =?UTF-8?q?=EB=A5=BC=20=EC=83=81=EC=88=98=EB=A1=9C=20=EC=A0=95=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- constants.js | 14 ++++++++++++++ docs/README.md | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 constants.js diff --git a/constants.js b/constants.js new file mode 100644 index 000000000..2f92c1b2d --- /dev/null +++ b/constants.js @@ -0,0 +1,14 @@ +const MINIMUM_INPUT_LENGTH = 2; +const MINIMUM_STATION_COUNT = 2; + +export const REGISTERD_STATION_MESSAGE = `๋…ธ์„ ์— ๋“ฑ๋ก๋œ ์—ญ์€ ์‚ญ์ œํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค!`; +export const DUPLICATED_STATION_MESSAGE = `์ค‘๋ณต๋œ ์ง€ํ•˜์ฒ  ์—ญ ์ด๋ฆ„์€ ๋“ฑ๋ก๋  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค!`; +export const TEXT_LENGTH_MESSAGE = `์ง€ํ•˜์ฒ  ์—ญ์€ ${MINIMUM_INPUT_LENGTH}๊ธ€์ž ์ด์ƒ์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค!`; + +export const DUPLICATED_LINE_MESSAGE = `์ค‘๋ณต๋œ ์ง€ํ•˜์ฒ  ๋…ธ์„  ์ด๋ฆ„์€ ๋“ฑ๋ก๋  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค!`; + +export const DUPLICATED_SECTION_MESSAGE = `๋…ธ์„  ๋‚ด์— ์ด๋ฏธ ๋“ฑ๋ก๋œ ์—ญ์ž…๋‹ˆ๋‹ค!`; +export const ORDER_MESSAGE = (number) => `์ˆœ์„œ๋Š” 0 ~ ${number}๋กœ ์ง€์ •ํ•ด์ฃผ์„ธ์š”!`; +export const MINIMUM_STATION_MESSAGE = `๋…ธ์„ ์—๋Š” ์—ญ์ด ${MINIMUM_STATION_COUNT} ๊ฐœ ์ด์ƒ ํฌํ•จ๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค!`; + +export const DELET_CONFIRM_MESSAGE = `์ •๋ง๋กœ ์‚ญ์ œํ•˜์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ?`; diff --git a/docs/README.md b/docs/README.md index 6fa5ce6f7..18c6bee3c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,5 +1,7 @@ ## ๐Ÿ“Œ ๊ตฌํ˜„ํ•  ๊ธฐ๋Šฅ ๋ชฉ๋ก +[x] alert ๋ฉ”์„ธ์ง€ ์ƒ์ˆ˜ ์ง€์ • + - ๋ฉ”๋‰ด ๊ธฐ๋Šฅ [x] ๋ฉ”๋‰ด ๋ฒ„ํŠผ ์ƒ์„ฑ [x] `1. ์—ญ ๊ด€๋ฆฌ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **์ง€ํ•˜์ฒ  ์—ญ ๊ด€๋ จ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ From 1332c34b76e6abe464eda4bdd0bb27f180406ac1 Mon Sep 17 00:00:00 2001 From: da1907 Date: Tue, 15 Dec 2020 23:43:34 +0900 Subject: [PATCH 6/6] =?UTF-8?q?feat:=20=EA=B0=81=20=EB=A9=94=EB=89=B4?= =?UTF-8?q?=EB=93=A4=EC=9D=98=20ui=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 6 +- src/template.js | 154 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 157 insertions(+), 3 deletions(-) create mode 100644 src/template.js diff --git a/docs/README.md b/docs/README.md index 18c6bee3c..bafe0a008 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,7 +10,7 @@ [x] `4. ์ง€ํ•˜์ฒ  ๋…ธ์„ ๋„ ์ถœ๋ ฅ` ๋ฒ„ํŠผ ๋ˆ„๋ฅด๋ฉด **๋ชจ๋“  ๋…ธ์„ ์˜ ์—ญ ์กฐํšŒ ๊ธฐ๋Šฅ** ํ™”๋ฉด ์ถœ๋ ฅ - ์ง€ํ•˜์ฒ  ์—ญ ๊ด€๋ จ ๊ธฐ๋Šฅ - [ ] UI ๊ตฌํ˜„ + [x] UI ๊ตฌํ˜„ [ ] ์ง€ํ•˜์ฒ  ์—ญ ๋“ฑ๋ก [ ] ์—ญ ์ด๋ฆ„ ์ค‘๋ณต ์—ฌ๋ถ€ ์ฒดํฌ [ ] ์—ญ ์ด๋ฆ„ ๋‘ ๊ธ€์ž ์ด์ƒ์ธ์ง€ ์ฒดํฌ @@ -19,14 +19,14 @@ [ ] ๋…ธ์„ ์— ๋“ฑ๋ก๋˜์–ด ์žˆ๋Š” ์—ญ์ธ์ง€ ์ฒดํฌ - ์ง€ํ•˜์ฒ  ๋…ธ์„  ๊ด€๋ จ ๊ธฐ๋Šฅ - [ ] UI ๊ตฌํ˜„ + [x] UI ๊ตฌํ˜„ [ ] ๋…ธ์„  ์ด๋ฆ„, ์ƒํ–‰ ์ข…์ ์—ญ, ํ•˜ํ–‰ ์ข…์ ์—ญ ์ž…๋ ฅ๋ฐ›๊ธฐ [ ] ๋…ธ์„  ์ด๋ฆ„ ์ค‘๋ณต ์—ฌ๋ถ€ ์ฒดํฌ [ ] ๋…ธ์„  ๋ชฉ๋ก์— ์ถ”๊ฐ€ [ ] ๋…ธ์„  ์‚ญ์ œ - ์ง€ํ•˜์ฒ  ๊ตฌ๊ฐ„ ๊ด€๋ จ ๊ธฐ๋Šฅ - [ ] UI ๊ตฌํ˜„ + [x] UI ๊ตฌํ˜„ [ ] ์ˆ˜์ •ํ•  ๋…ธ์„  ์ž…๋ ฅ๋ฐ›๊ธฐ [ ] ๊ตฌ๊ฐ„ ๋“ฑ๋ก [ ] ์ œ์ผ ์ฒ˜์Œ, ์ œ์ผ ๋์— ์ถ”๊ฐ€๋˜๋ฉด alert diff --git a/src/template.js b/src/template.js new file mode 100644 index 000000000..2e25b964d --- /dev/null +++ b/src/template.js @@ -0,0 +1,154 @@ +export const stationInput = () => { + return ` +

+ + `; +}; + +export const stationTable = () => { + return ` +

๐Ÿš‰์ง€ํ•˜์ฒ  ์—ญ ๋ชฉ๋ก

+ + + + + + + + ${stationList(stations)} +
์—ญ ์ด๋ฆ„์„ค์ •
`; +}; + +const stationList = (stations) => { + let count = 0; + return stations + .map( + (station) => + ` + ${station.name} + + + ` + ) + .join(''); +}; + +export const lineInput = (stations) => { + return ` +

+

+ ์ƒํ–‰ ์ข…์ 
+ ํ•˜ํ–‰ ์ข…์ 

+ `; +}; + +const stationSelectorOption = (stations) => { + return stations.map((station) => ``).join(''); +}; + +export const lineTable = (lines) => { + return ` +

๐Ÿš‰์ง€ํ•˜์ฒ  ๋…ธ์„  ๋ชฉ๋ก

+ + + + + + + + + + ${lineList(lines)} +
๋…ธ์„  ์ด๋ฆ„์ƒํ–‰ ์ข…์ ์—ญํ•˜ํ–‰ ์ข…์ ์—ญ์„ค์ •
`; +}; + +const lineList = (lines) => { + let count = 0; + return lines + .map( + (line) => + ` + ${line.name} + ${line.section[0]} + ${line.section[line.section.length - 1]} + + + + ` + ) + .join(''); +}; + +export const sectionLineMenuTemplate = (lines) => { + return ` +

๊ตฌ๊ฐ„์„ ์ˆ˜์ •ํ•  ๋…ธ์„ ์„ ์„ ํƒํ•ด์ฃผ์„ธ์š”.

+ ${lineNumbersToBtn(lines)}`; +}; + +const lineNumbersToBtn = (lines) => { + let count = 0; + return lines + .map( + (line) => ` + ` + ) + .join(''); +}; + +export const sectionInput = (line, stations) => { + return ` +

${line} ๊ด€๋ฆฌ

+

๊ตฌ๊ฐ„ ๋“ฑ๋ก

+ + +

`; +}; + +export const sectionTable = (sections) => { + return ` + + + + + + + + + ${sectionList(sections)} +
์ˆœ์„œ์ด๋ฆ„์„ค์ •
`; +}; + +const sectionList = (sections) => { + let count = 0; + return sections + .map( + (section) => ` + + ${count} + ${section} + + ` + ) + .join(''); +}; + +export const mapPrint = (lines) => { + return lines + .map( + (line) => ` +

${line.name}

+
    + ${showSection(line.section)} +
` + ) + .join(''); +}; + +const showSection = (sections) => { + return sections.map((section) => `
  • ${section}
  • `).join(''); +};