diff --git a/components/BottomSheetMonthPicker.vue b/components/BottomSheetMonthPicker.vue
new file mode 100644
index 0000000..de281fb
--- /dev/null
+++ b/components/BottomSheetMonthPicker.vue
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ pickerYear }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/changelog.md b/docs/changelog.md
index 364fd52..d174b49 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -32,3 +32,4 @@
- SVG 메뉴 아이콘이 사각형으로 보이는 문제를 수정하고 활성 아이콘 배경을 추가했다.
- 내역 검색과 유형/자산/카테고리 필터 바텀 시트를 구현했다.
- 거래 목록 API에 검색어, 유형, 자산, 카테고리 필터 query를 추가했다.
+- 월 선택 바텀 시트를 공통 컴포넌트로 분리하고 내역, 통계, 자산 화면에 적용했다.
diff --git a/pages/assets.vue b/pages/assets.vue
index 38b8291..7c2ff5f 100644
--- a/pages/assets.vue
+++ b/pages/assets.vue
@@ -107,43 +107,7 @@
-
-
-
-
-
-
-
-
-
-
{{ pickerYear }}
-
-
-
-
-
-
-
-
+
@@ -154,7 +118,6 @@ import type { Transaction } from '~/composables/useMoney'
const selectedMonth = ref(monthKey())
const selectedAssetId = ref('')
const monthPickerOpen = ref(false)
-const pickerYear = ref(Number(selectedMonth.value.slice(0, 4)))
const { data: assetData } = await useFetch('/api/assets', { query: { month: selectedMonth } })
const { data: transactionData } = await useFetch('/api/transactions', { query: { month: selectedMonth } })
@@ -198,22 +161,8 @@ const groupedTransactions = computed(() => {
return Array.from(groups.values()).sort((a, b) => b.date.localeCompare(a.date))
})
-watch(monthPickerOpen, (open) => {
- if (open) pickerYear.value = Number(selectedMonth.value.slice(0, 4))
-})
-
function moveMonth(amount: number) {
const date = parse(selectedMonth.value, 'yyyy-MM', new Date())
selectedMonth.value = format(addMonths(date, amount), 'yyyy-MM')
}
-
-function isSelectedPickerMonth(month: number) {
- return selectedMonth.value === `${pickerYear.value}-${String(month).padStart(2, '0')}`
-}
-
-function selectPickerMonth(month: number) {
- selectedMonth.value = `${pickerYear.value}-${String(month).padStart(2, '0')}`
- monthPickerOpen.value = false
-}
-
diff --git a/pages/index.vue b/pages/index.vue
index fec8284..4653197 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -29,7 +29,7 @@
-