@@ -5,11 +5,13 @@ import { cn } from "@hypr/utils";
55
66import { useAudioPlayer , useAudioTime } from "./provider" ;
77
8+ import { useBillingAccess } from "~/auth/billing" ;
89import { useNativeContextMenu } from "~/shared/hooks/useNativeContextMenu" ;
910
1011const PLAYBACK_RATES = [ 0.5 , 0.75 , 1 , 1.25 , 1.5 , 1.75 , 2 ] ;
1112
1213export function Timeline ( ) {
14+ const { isPro } = useBillingAccess ( ) ;
1315 const {
1416 registerContainer,
1517 state,
@@ -116,49 +118,51 @@ export function Timeline() {
116118 < span > { formatTime ( time . total ) } </ span >
117119 </ div >
118120
119- < div className = "relative shrink-0" ref = { rateMenuRef } >
120- < button
121- onClick = { ( ) => setShowRateMenu ( ( prev ) => ! prev ) }
122- className = { cn ( [
123- "flex items-center justify-center" ,
124- "h-6 rounded-md px-1.5" ,
125- "border border-neutral-200 bg-white" ,
126- "transition-colors hover:bg-neutral-100" ,
127- "font-mono text-xs text-neutral-700 select-none" ,
128- "shadow-xs" ,
129- ] ) }
130- >
131- { playbackRate } x
132- </ button >
133- { showRateMenu && (
134- < div
121+ { isPro ? (
122+ < div className = "relative shrink-0" ref = { rateMenuRef } >
123+ < button
124+ onClick = { ( ) => setShowRateMenu ( ( prev ) => ! prev ) }
135125 className = { cn ( [
136- "absolute right-0 bottom-full mb-1" ,
137- "rounded-lg border border-neutral-200 bg-white shadow-md" ,
138- "z-50 py-1" ,
126+ "flex items-center justify-center" ,
127+ "h-6 rounded-md px-1.5" ,
128+ "border border-neutral-200 bg-white" ,
129+ "transition-colors hover:bg-neutral-100" ,
130+ "font-mono text-xs text-neutral-700 select-none" ,
131+ "shadow-xs" ,
139132 ] ) }
140133 >
141- { PLAYBACK_RATES . map ( ( rate ) => (
142- < button
143- key = { rate }
144- onClick = { ( ) => {
145- setPlaybackRate ( rate ) ;
146- setShowRateMenu ( false ) ;
147- } }
148- className = { cn ( [
149- "block w-full px-3 py-1 text-left font-mono text-xs select-none" ,
150- "transition-colors hover:bg-neutral-100" ,
151- rate === playbackRate
152- ? "font-semibold text-neutral-900"
153- : "text-neutral-600" ,
154- ] ) }
155- >
156- { rate } x
157- </ button >
158- ) ) }
159- </ div >
160- ) }
161- </ div >
134+ { playbackRate } x
135+ </ button >
136+ { showRateMenu && (
137+ < div
138+ className = { cn ( [
139+ "absolute right-0 bottom-full mb-1" ,
140+ "rounded-lg border border-neutral-200 bg-white shadow-md" ,
141+ "z-50 py-1" ,
142+ ] ) }
143+ >
144+ { PLAYBACK_RATES . map ( ( rate ) => (
145+ < button
146+ key = { rate }
147+ onClick = { ( ) => {
148+ setPlaybackRate ( rate ) ;
149+ setShowRateMenu ( false ) ;
150+ } }
151+ className = { cn ( [
152+ "block w-full px-3 py-1 text-left font-mono text-xs select-none" ,
153+ "transition-colors hover:bg-neutral-100" ,
154+ rate === playbackRate
155+ ? "font-semibold text-neutral-900"
156+ : "text-neutral-600" ,
157+ ] ) }
158+ >
159+ { rate } x
160+ </ button >
161+ ) ) }
162+ </ div >
163+ ) }
164+ </ div >
165+ ) : null }
162166
163167 < div
164168 ref = { registerContainer }
0 commit comments