Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
import { computed, ref } from 'vue'
import { useI18n } from 'vue-i18n'

import CardEditDialog from './CardEditDialog.vue'
import DeleteCardDialog from './DeleteCardDialog.vue'

interface Props {
Expand Down Expand Up @@ -77,6 +78,9 @@ const isActive = computed(() => props.cardId === activeCardId.value)
// Animation control for card activation
const isActivating = ref(false)

// Edit dialog state
const isEditDialogOpen = ref(false)

function handleActivate() {
isActivating.value = true
setTimeout(() => {
Expand Down Expand Up @@ -194,6 +198,14 @@ const activeTab = computed({

<!-- Action buttons -->
<div flex="~ row" gap-2>
<!-- Edit button -->
<Button
variant="secondary"
icon="i-solar:clapperboard-edit-line-duotone"
:label="t('settings.pages.card.edit.edit')"
@click="isEditDialogOpen = true"
/>
Comment on lines +202 to +207
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Consider extracting this button into a separate component to improve reusability and maintainability. This would also simplify the CardDetailDialog.vue component and make it easier to read.

If the button is only used in this component, this is less important, but if it's used in multiple places, it would be beneficial to extract it.


<!-- Activation button -->
<Button
variant="primary"
Expand All @@ -203,6 +215,14 @@ const activeTab = computed({
:class="{ 'animate-pulse': isActivating }"
@click="handleActivate"
/>

<!-- Delete button -->
<Button
variant="danger"
icon="i-solar:trash-bin-minimalistic-bold"
:label="t('settings.pages.card.delete')"
@click="showDeleteConfirm = true"
/>
</div>
</div>

Expand Down Expand Up @@ -344,6 +364,12 @@ const activeTab = computed({
</DialogPortal>
</DialogRoot>

<!-- Edit card dialog -->
<CardEditDialog
v-model="isEditDialogOpen"
:card-id="props.cardId"
/>

<!-- Delete confirmation dialog -->
<DeleteCardDialog
v-model="showDeleteConfirm"
Expand Down
Loading