diff --git a/frontend/components/build/Viewer.vue b/frontend/components/build/Viewer.vue index 77dc8ad..7ad8548 100644 --- a/frontend/components/build/Viewer.vue +++ b/frontend/components/build/Viewer.vue @@ -1,6 +1,6 @@ - - - - diff --git a/frontend/components/rune/Selector.vue b/frontend/components/rune/Selector.vue deleted file mode 100644 index 3d00d07..0000000 --- a/frontend/components/rune/Selector.vue +++ /dev/null @@ -1,152 +0,0 @@ - - - - - diff --git a/frontend/composables/useBuilds.ts b/frontend/composables/useBuilds.ts new file mode 100644 index 0000000..9561092 --- /dev/null +++ b/frontend/composables/useBuilds.ts @@ -0,0 +1,32 @@ +/** + * Composable for managing build data with automatic trimming + * Handles deep cloning and tree manipulation + */ +import { deepClone } from '~/utils/helpers' +import { trimBuilds, trimLateGameItems } from '~/utils/buildHelpers' + +export const useBuilds = (buildsProp: Ref) => { + const builds = ref(deepClone(buildsProp.value)) + + function trimBuildData(): void { + trimBuilds(builds.value) + trimLateGameItems(builds.value) + } + + // Watch for changes and rebuild + watch( + () => buildsProp.value, + (newBuilds) => { + builds.value = deepClone(newBuilds) + trimBuildData() + }, + { deep: true } + ) + + // Initial trim on mount + onMounted(() => { + trimBuildData() + }) + + return { builds } +} \ No newline at end of file diff --git a/frontend/utils/mockData.ts b/frontend/utils/mockData.ts new file mode 100644 index 0000000..3290f1f --- /dev/null +++ b/frontend/utils/mockData.ts @@ -0,0 +1,16 @@ +/** + * Mock data for development and fallback scenarios + * Used when API data is not available + */ + +export const MOCK_SUMMONER_SPELLS = [ + { id: 4, count: 1000, pickrate: 0.45 }, // Flash + { id: 7, count: 800, pickrate: 0.35 }, // Heal + { id: 14, count: 600, pickrate: 0.15 }, // Ignite + { id: 3, count: 200, pickrate: 0.05 } // Exhaust +] + +/** + * Constants used throughout the application + */ +export const BOOTS_RUSH_THRESHOLD = 0.5 \ No newline at end of file