File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
packages/features/bookings/components/event-meta Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,10 @@ import type { PublicEvent } from "../../types";
99
1010export const EventDuration = ( { event } : { event : PublicEvent } ) => {
1111 const { t } = useLocale ( ) ;
12- const [ selectedDuration , setSelectedDuration ] = useBookerStore ( ( state ) => [
12+ const [ selectedDuration , setSelectedDuration , state ] = useBookerStore ( ( state ) => [
1313 state . selectedDuration ,
1414 state . setSelectedDuration ,
15+ state . state ,
1516 ] ) ;
1617
1718 const isDynamicEvent = "isDynamic" in event && event . isDynamic ;
@@ -30,14 +31,16 @@ export const EventDuration = ({ event }: { event: PublicEvent }) => {
3031
3132 return (
3233 < div className = "flex flex-wrap gap-2" >
33- { durations . map ( ( duration ) => (
34- < Badge
35- variant = "gray"
36- className = { classNames ( selectedDuration === duration && "bg-brand-default text-brand" ) }
37- size = "md"
38- key = { duration }
39- onClick = { ( ) => setSelectedDuration ( duration ) } > { `${ duration } ${ t ( "minute_timeUnit" ) } ` } </ Badge >
40- ) ) }
34+ { durations
35+ . filter ( ( dur ) => state !== "booking" || dur === selectedDuration )
36+ . map ( ( duration ) => (
37+ < Badge
38+ variant = "gray"
39+ className = { classNames ( selectedDuration === duration && "bg-brand-default text-brand" ) }
40+ size = "md"
41+ key = { duration }
42+ onClick = { ( ) => setSelectedDuration ( duration ) } > { `${ duration } ${ t ( "minute_timeUnit" ) } ` } </ Badge >
43+ ) ) }
4144 </ div >
4245 ) ;
4346} ;
You can’t perform that action at this time.
0 commit comments