({ domain: d, onDelete }: { domain: DomainData; onDelete: () => void })
| 314 | } |
| 315 | |
| 316 | function DomainCard({ domain: d, onDelete }: { domain: DomainData; onDelete: () => void }) { |
| 317 | const isVerified = d.state === "verified"; |
| 318 | const isPending = d.state === "pending"; |
| 319 | |
| 320 | const recordValue = d.verificationPrefix |
| 321 | ? `${d.verificationPrefix}=${d.verificationToken}` |
| 322 | : (d.verificationToken ?? ""); |
| 323 | |
| 324 | const copyPromptValue = `Add a DNS TXT record for domain verification:\n\nDomain: ${d.domain}\nRecord name: @\nRecord value: ${recordValue}\n\nPlease add this TXT record to my DNS configuration.`; |
| 325 | |
| 326 | return ( |
| 327 | <div className="rounded-lg border border-border"> |
| 328 | <div className="flex items-center gap-3 px-4 py-3"> |
| 329 | <div className="min-w-0 flex-1"> |
| 330 | <div className="flex items-center gap-2"> |
| 331 | <p className="truncate text-sm font-medium text-foreground">{d.domain}</p> |
| 332 | <Badge |
| 333 | className={ |
| 334 | isVerified |
| 335 | ? "bg-muted text-foreground" |
| 336 | : isPending |
| 337 | ? "bg-muted text-muted-foreground" |
| 338 | : "bg-destructive/10 text-destructive" |
| 339 | } |
| 340 | > |
| 341 | {isVerified ? "Verified" : isPending ? "Pending" : "Failed"} |
| 342 | </Badge> |
| 343 | </div> |
| 344 | </div> |
| 345 | <div className="flex shrink-0 items-center gap-1.5"> |
| 346 | <DropdownMenu> |
| 347 | <DropdownMenuTrigger asChild> |
| 348 | <Button variant="ghost" size="icon" className="size-7"> |
| 349 | <svg viewBox="0 0 16 16" className="size-3"> |
| 350 | <circle cx="8" cy="3" r="1.2" fill="currentColor" /> |
| 351 | <circle cx="8" cy="8" r="1.2" fill="currentColor" /> |
| 352 | <circle cx="8" cy="13" r="1.2" fill="currentColor" /> |
| 353 | </svg> |
| 354 | </Button> |
| 355 | </DropdownMenuTrigger> |
| 356 | <DropdownMenuContent align="end" className="w-44"> |
| 357 | <DropdownMenuItem |
| 358 | className="text-destructive focus:text-destructive text-sm" |
| 359 | onClick={onDelete} |
| 360 | > |
| 361 | Remove domain |
| 362 | </DropdownMenuItem> |
| 363 | </DropdownMenuContent> |
| 364 | </DropdownMenu> |
| 365 | </div> |
| 366 | </div> |
| 367 | |
| 368 | {!isVerified && d.verificationToken && ( |
| 369 | <div className="border-t border-border px-4 py-3"> |
| 370 | <div className="flex items-center justify-between"> |
| 371 | <p className="text-sm text-muted-foreground"> |
| 372 | Add this TXT record to your DNS provider to verify ownership. |
| 373 | </p> |
nothing calls this directly
no outgoing calls
no test coverage detected