Skip to content

Commit db29ea5

Browse files
author
Erlend Oftedal
committed
Refactoring into components
1 parent 992b1fc commit db29ea5

11 files changed

Lines changed: 559 additions & 386 deletions

src/components/ActionButtons.vue

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<script setup lang="ts">
2+
defineProps<{
3+
matchCount: number
4+
}>()
5+
6+
defineEmits<{
7+
execute: []
8+
expand: []
9+
}>()
10+
</script>
11+
12+
<template>
13+
<div class="button-group">
14+
<button @click="$emit('execute')" class="execute-btn">Execute Query</button>
15+
<button @click="$emit('expand')" class="expand-btn" :disabled="matchCount === 0">
16+
Expand to Results
17+
</button>
18+
</div>
19+
</template>
20+
21+
<style scoped>
22+
.button-group {
23+
display: flex;
24+
gap: 10px;
25+
}
26+
27+
.execute-btn,
28+
.expand-btn {
29+
background: #4caf50;
30+
color: white;
31+
border: none;
32+
padding: 12px 24px;
33+
font-size: 16px;
34+
font-weight: 600;
35+
border-radius: 4px;
36+
cursor: pointer;
37+
transition: background-color 0.2s;
38+
}
39+
40+
.expand-btn {
41+
background: #2196f3;
42+
}
43+
44+
.execute-btn:hover {
45+
background: #45a049;
46+
}
47+
48+
.expand-btn:hover:not(:disabled) {
49+
background: #1976d2;
50+
}
51+
52+
.expand-btn:disabled {
53+
background: #ccc;
54+
cursor: not-allowed;
55+
opacity: 0.6;
56+
}
57+
58+
.execute-btn:active {
59+
background: #3d8b40;
60+
}
61+
</style>

0 commit comments

Comments
 (0)