|
18 | 18 | let { |
19 | 19 | item, |
20 | 20 | onMarkEmptied, |
| 21 | + onUndoEmptied, |
21 | 22 | onRemove, |
22 | 23 | onEdit, |
23 | 24 | selectMode = false, |
|
26 | 27 | }: { |
27 | 28 | item: PanItem; |
28 | 29 | onMarkEmptied?: (id: number) => void; |
| 30 | + onUndoEmptied?: (id: number) => void; |
29 | 31 | onRemove?: (id: number) => void; |
30 | 32 | onEdit?: (id: number) => void; |
31 | 33 | selectMode?: boolean; |
|
84 | 86 | <ProgressBar value={percentage} height="8px" /> |
85 | 87 | </div> |
86 | 88 |
|
87 | | - {#if onMarkEmptied} |
88 | | - <button |
89 | | - class="mark-emptied-btn" |
90 | | - class:complete={isComplete} |
91 | | - disabled={isComplete} |
92 | | - onclick={() => onMarkEmptied(item.id)} |
93 | | - > |
94 | | - {#if isComplete} |
95 | | - <i class="ri-check-double-line"></i> |
96 | | - {:else} |
97 | | - <i class="ri-check-line"></i> |
98 | | - {/if} |
99 | | - {t.panProject.markEmptied} |
100 | | - </button> |
101 | | - {/if} |
| 89 | + <div class="btn-row"> |
| 90 | + {#if onUndoEmptied && item.emptied > 0} |
| 91 | + <button |
| 92 | + class="undo-emptied-btn" |
| 93 | + onclick={() => onUndoEmptied(item.id)} |
| 94 | + > |
| 95 | + <i class="ri-arrow-go-back-line"></i> |
| 96 | + {t.panProject.undoEmptied} |
| 97 | + </button> |
| 98 | + {/if} |
| 99 | + {#if onMarkEmptied} |
| 100 | + <button |
| 101 | + class="mark-emptied-btn" |
| 102 | + class:complete={isComplete} |
| 103 | + onclick={() => onMarkEmptied(item.id)} |
| 104 | + > |
| 105 | + {#if isComplete} |
| 106 | + <i class="ri-check-double-line"></i> |
| 107 | + {:else} |
| 108 | + <i class="ri-check-line"></i> |
| 109 | + {/if} |
| 110 | + {t.panProject.markEmptied} |
| 111 | + </button> |
| 112 | + {/if} |
| 113 | + </div> |
102 | 114 | </div> |
103 | 115 |
|
104 | 116 | <style> |
|
212 | 224 | color: var(--text-soft); |
213 | 225 | } |
214 | 226 |
|
| 227 | + .btn-row { |
| 228 | + display: flex; |
| 229 | + gap: 8px; |
| 230 | + } |
| 231 | +
|
| 232 | + .undo-emptied-btn { |
| 233 | + flex: 0 0 auto; |
| 234 | + padding: 10px 14px; |
| 235 | + border: 1px solid rgba(0, 0, 0, 0.06); |
| 236 | + border-radius: 50px; |
| 237 | + background: white; |
| 238 | + font-family: 'Poppins', sans-serif; |
| 239 | + font-size: 13px; |
| 240 | + font-weight: 600; |
| 241 | + color: var(--text-soft); |
| 242 | + cursor: pointer; |
| 243 | + display: flex; |
| 244 | + align-items: center; |
| 245 | + justify-content: center; |
| 246 | + gap: 6px; |
| 247 | + transition: 0.2s; |
| 248 | + -webkit-tap-highlight-color: transparent; |
| 249 | + touch-action: manipulation; |
| 250 | + } |
| 251 | +
|
| 252 | + .undo-emptied-btn:active { |
| 253 | + transform: scale(0.98); |
| 254 | + background: #f5f5f5; |
| 255 | + } |
| 256 | +
|
215 | 257 | .mark-emptied-btn { |
216 | | - width: 100%; |
| 258 | + flex: 1; |
217 | 259 | padding: 10px; |
218 | 260 | border: 1px solid rgba(0, 0, 0, 0.06); |
219 | 261 | border-radius: 50px; |
|
0 commit comments