feat(domaincheck): support all TLDs with suggestion alternatives
- Accept full domains (e.g. "example.xyz") not just labels - Check the entered TLD as primary result - Show .de, .com, .net, .org as alternative suggestions below - Primary result highlighted with accent border - Input without TLD still works (shows all 4 suggestions) - Updated i18n placeholders and added "suggestions" label Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,16 +1,10 @@
|
||||
/**
|
||||
* Client-side action to check domain availability via the API.
|
||||
*
|
||||
* Calls POST /modules/domaincheck/check with the domain label.
|
||||
* Auth cookie is forwarded via credentials: 'include'.
|
||||
*/
|
||||
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3001';
|
||||
|
||||
export interface DomainCheckResult {
|
||||
tld: string;
|
||||
fqdn: string;
|
||||
status: 'available' | 'registered';
|
||||
primary: boolean;
|
||||
}
|
||||
|
||||
export interface DomainCheckResponse {
|
||||
@@ -18,13 +12,6 @@ export interface DomainCheckResponse {
|
||||
results: DomainCheckResult[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Check domain availability across TLD variants.
|
||||
*
|
||||
* @param domain - Base domain label (e.g., "example")
|
||||
* @returns Response with domain and results array
|
||||
* @throws Error if the API call fails
|
||||
*/
|
||||
export async function checkDomainAction(
|
||||
domain: string,
|
||||
): Promise<DomainCheckResponse> {
|
||||
|
||||
Reference in New Issue
Block a user