[]>(
() => [
{
id: "voice",
accessorKey: "voice_name",
header: t("voice"),
size: 200,
cell: ({ row }) => (
{row.original.voice_name}
),
},
{
id: "trait",
accessorKey: "accent",
header: t("trait"),
size: 200,
cell: ({ row }) => (
{row.original.accent && (
{row.original.accent}
)}
{row.original.gender && (
{row.original.gender}
)}
{row.original.provider && (
{row.original.provider}
)}
{row.original.age && (
{row.original.age}
)}
),
},
{
id: "voice_id",
accessorKey: "voice_id",
header: t("voice_id"),
size: 200,
cell: ({ row }) => (
{row.original.voice_id}
),
},
{
id: "actions",
header: "",
size: 120,
cell: ({ row }) => (
),
},
],
[t, playingVoiceId, selectedVoiceId]
);
const table = useReactTable({
data: voiceData,
columns,
enableRowSelection: false,
manualPagination: false,
state: {
rowSelection,
},
getCoreRowModel: getCoreRowModel(),
getSortedRowModel: getSortedRowModel(),
onRowSelectionChange: setRowSelection,
getRowId: (row) => row.voice_id,
});
return (
testId="voice-selection-data-table"
table={table}
isPending={isLoading}
totalRowCount={voiceData?.length || 0}
paginationMode="standard"
className="h-auto"
/>
);
}
export function VoiceSelectionDialog({
open,
onOpenChange,
selectedVoiceId,
onVoiceSelect,
}: VoiceSelectionDialogProps) {
const { t } = useLocale();
const handleVoiceSelect = (voiceId: string) => {
onVoiceSelect(voiceId);
onOpenChange(false);
};
return (
);
}