Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
useMultibandTrackVolume,
} from '@livekit/components-react';
import { useAgentAudioVisualizerBarAnimator } from '@/hooks/agents-ui/use-agent-audio-visualizer-bar';
import { cn, normalizeVolumeBands } from '@/lib/utils';
import { cn } from '@/lib/utils';

/**
* Resizes an array of per-band volume values to exactly `count` entries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
type Coordinate,
useAgentAudioVisualizerGridAnimator,
} from '@/hooks/agents-ui/use-agent-audio-visualizer-grid';
import { cn, normalizeVolumeBands } from '@/lib/utils';
import { cn } from '@/lib/utils';

/**
* Resizes an array of per-band volume values to exactly `count` entries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
type TrackReferenceOrPlaceholder,
useMultibandTrackVolume,
} from '@livekit/components-react';
import { cn, normalizeVolumeBands } from '@/lib/utils';
import { cn } from '@/lib/utils';
import { useAgentAudioVisualizerRadialAnimator } from '@/hooks/agents-ui/use-agent-audio-visualizer-radial';

/**
Expand Down
12 changes: 0 additions & 12 deletions packages/shadcn/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,3 @@ import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}

/**
* Resizes an array of per-band volume values to exactly `count` entries.
* Excess values are trimmed from the end; if there are too few, the last
* value is duplicated to fill the remainder. An empty array is padded with 0s.
*/
export function normalizeVolumeBands(bands: number[], count: number): number[] {
if (bands.length === count) return bands;
if (bands.length > count) return bands.slice(0, count);
const lastValue = bands[bands.length - 1] ?? 0;
return [...bands, ...new Array(count - bands.length).fill(lastValue)];
}
24 changes: 0 additions & 24 deletions packages/shadcn/tests/utils.test.ts

This file was deleted.

Loading