fix dialog (#26298)

This commit is contained in:
Manas Kenge authored and GitHub committed 2025-12-30 07:49:46 +00:00
1 parent ec90c1ae24
commit 7c1a3b0c15
2 files changed
+46 -128

No files matched your search

@@ -1,6 +1,6 @@
import { getCoreRowModel, getSortedRowModel, useReactTable, type ColumnDef } from "@tanstack/react-table";
import { usePathname } from "next/navigation";
import { useMemo, useState } from "react";
import { useMemo, useState, useCallback } from "react";
import { DataTableProvider, DataTableWrapper } from "@calcom/features/data-table";
import { useSegments } from "@calcom/features/data-table/hooks/useSegments";
@@ -58,10 +58,10 @@ function VoiceSelectionContent({
const { data: voices, isLoading } = trpc.viewer.aiVoiceAgent.listVoices.useQuery();
const handleUseVoice = (voiceId: string) => {
const handleUseVoice = useCallback((voiceId: string) => {
onVoiceSelect(voiceId);
showToast("Voice selected successfully", "success");
};
}, [onVoiceSelect]);
const voiceData: Voice[] = useMemo(() => {
if (!voices) return [];
@@ -105,7 +105,7 @@ function VoiceSelectionContent({
header: t("trait"),
size: 200,
cell: ({ row }) => (
<div className="flex gap-2 text-sm">
<div className="flex flex-wrap gap-2 text-sm sm:flex-nowrap">
{row.original.accent && (
<span className="bg-subtle text-default rounded-md px-2 py-1 text-xs">
{row.original.accent}
@@ -145,12 +145,12 @@ function VoiceSelectionContent({
color={selectedVoiceId === row.original.voice_id ? "primary" : "secondary"}
onClick={() => handleUseVoice(row.original.voice_id)}
className="whitespace-nowrap">
{selectedVoiceId === row.original.voice_id ? <>{t("current_voice")}</> : t("use_voice")}
{selectedVoiceId === row.original.voice_id ? t("current_voice") : t("use_voice")}
</Button>
),
},
],
[t, playingVoiceId, selectedVoiceId]
[t, playingVoiceId, selectedVoiceId, handlePlayVoice, handleUseVoice]
);
const table = useReactTable({
@@ -196,7 +196,7 @@ export function VoiceSelectionDialog({
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent enableOverflow className="flex h-[80vh] flex-col p-6 sm:max-w-7xl">
<DialogContent enableOverflow size="md" className="flex flex-col p-6 sm:max-w-7xl">
<DialogHeader title={t("select_voice")} subtitle={t("choose_a_voice_for_your_agent")} />
<div className="mt-4 min-h-0 flex-1 overflow-hidden">