mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-25 08:48:13 +02:00
chore: format code with pre-commit script
This commit is contained in:
parent
30eebfe811
commit
000c648e7e
8 changed files with 161 additions and 110 deletions
|
|
@ -1,11 +1,12 @@
|
|||
"use client";
|
||||
|
||||
import {useState } from "react";
|
||||
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
import { type EndCallMessageType } from "../../config";
|
||||
|
||||
|
|
@ -53,14 +54,14 @@ export function TransferCallToolConfig({
|
|||
|
||||
const getValidationError = (): string | null => {
|
||||
if (!destination) return null;
|
||||
|
||||
|
||||
if (sipMode) {
|
||||
return isValidSipEndpoint(destination)
|
||||
? null
|
||||
return isValidSipEndpoint(destination)
|
||||
? null
|
||||
: "Please enter a valid SIP endpoint (e.g., PJSIP/1234 or SIP/extension@domain.com)";
|
||||
} else {
|
||||
return isValidPhoneNumber(destination)
|
||||
? null
|
||||
return isValidPhoneNumber(destination)
|
||||
? null
|
||||
: "Please enter a valid phone number in E.164 format (e.g., +1234567890)";
|
||||
}
|
||||
};
|
||||
|
|
@ -109,7 +110,7 @@ export function TransferCallToolConfig({
|
|||
<div className="grid gap-2 pt-4 border-t">
|
||||
<Label>Transfer Destination</Label>
|
||||
<Label className="text-xs text-muted-foreground">
|
||||
{sipMode
|
||||
{sipMode
|
||||
? "SIP endpoint to transfer the call to (e.g., PJSIP/1234 or SIP/extension@domain.com)"
|
||||
: "Phone number to transfer the call to (E.164 format with country code)"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ export default function ToolDetailPage() {
|
|||
const sipPattern = /^(PJSIP|SIP)\/[\w\-\.@]+$/i;
|
||||
const isValidE164 = e164Pattern.test(transferDestination);
|
||||
const isValidSip = sipPattern.test(transferDestination);
|
||||
|
||||
|
||||
if (!transferDestination || (!isValidE164 && !isValidSip)) {
|
||||
setError("Please enter a valid phone number (E.164 format) or SIP endpoint (e.g., PJSIP/1234)");
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue