|
1 | 1 | import { Eye, EyeOff, Search, Settings, Trash2 } from "lucide-react" |
2 | 2 | import { useMemo, useState } from "react" |
3 | 3 | import { twMerge } from "tailwind-merge" |
4 | | -import { badgeCVA } from "@/components/design" |
| 4 | +import { badgeCVA, typeIcons } from "@/components/design" |
5 | 5 | import MultiSegment from "@/components/MultiSegment" |
6 | 6 | import { allLeafValues } from "@/components/misc" |
7 | 7 | import type { CommentTableRow } from "@/entrypoints/background" |
@@ -100,11 +100,6 @@ export function PopupRoot({ drafts }: PopupRootProps) { |
100 | 100 | showTrashed: true, |
101 | 101 | }) |
102 | 102 | } |
103 | | - |
104 | | - if (drafts.length === 0) { |
105 | | - return <EmptyState /> |
106 | | - } |
107 | | - |
108 | 103 | return ( |
109 | 104 | <div className="bg-white"> |
110 | 105 | {/* Bulk actions bar - floating popup */} |
@@ -214,10 +209,12 @@ export function PopupRoot({ drafts }: PopupRootProps) { |
214 | 209 | </tr> |
215 | 210 | </thead> |
216 | 211 | <tbody className="divide-y divide-gray-200"> |
| 212 | + |
217 | 213 | {filteredDrafts.length === 0 && ( |
218 | 214 | <tr> |
219 | 215 | <td colSpan={2}> |
220 | | - <NoMatchesState onClearFilters={clearFilters} /> |
| 216 | + {drafts.length === 0 && <EmptyState />} |
| 217 | + {drafts.length > 0 && <NoMatchesState onClearFilters={clearFilters} />} |
221 | 218 | </td> |
222 | 219 | </tr> |
223 | 220 | )} |
@@ -258,14 +255,21 @@ export function PopupRoot({ drafts }: PopupRootProps) { |
258 | 255 | overtype |
259 | 256 | </a> |
260 | 257 | </div> |
261 | | - <div> |
262 | | - drafts are not being saved{" "} |
| 258 | + <div className="flex items-center gap-2"> |
| 259 | + drafts are not being saved |
263 | 260 | <a |
264 | 261 | href="https://github.com/diffplug/gitcasso/issues/26" |
265 | 262 | target="_blank" |
266 | 263 | rel="noopener noreferrer" |
267 | | - className="text-blue-600 hover:underline" |
| 264 | + className={twMerge( |
| 265 | + badgeCVA({ type: "save", clickable: true }), |
| 266 | + "hover:opacity-90" |
| 267 | + )} |
268 | 268 | > |
| 269 | + {(() => { |
| 270 | + const SaveIcon = typeIcons.save |
| 271 | + return <SaveIcon className="h-3 w-3" /> |
| 272 | + })()} |
269 | 273 | save my drafts |
270 | 274 | </a> |
271 | 275 | </div> |
|
0 commit comments