11"use client" ;
22
3- import { memo , useMemo , useCallback } from "react" ;
4-
53import dayjs from "@calcom/dayjs" ;
64import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader" ;
75import { getHolidayEmoji } from "@calcom/lib/holidays/getHolidayEmoji" ;
@@ -10,12 +8,12 @@ import type { RouterOutputs } from "@calcom/trpc/react";
108import { trpc } from "@calcom/trpc/react" ;
119import { Alert } from "@calcom/ui/components/alert" ;
1210import { Button } from "@calcom/ui/components/button" ;
13- import { Select } from "@calcom/ui/components/form" ;
14- import { Switch } from "@calcom/ui/components/form " ;
11+ import { Select , Switch } from "@calcom/ui/components/form" ;
12+ import { Icon } from "@calcom/ui/components/icon " ;
1513import { SkeletonContainer , SkeletonText } from "@calcom/ui/components/skeleton" ;
16- import { CalendarIcon , TriangleAlertIcon } from "@coss/ui/icons" ;
14+ import { TriangleAlertIcon } from "@coss/ui/icons" ;
1715import { showToast } from "@calcom/ui/components/toast" ;
18-
16+ import { memo , useCallback , useMemo } from "react" ;
1917import { OutOfOfficeToggleGroup } from "~/settings/outOfOffice/OutOfOfficeToggleGroup" ;
2018
2119function HolidaysCTA ( ) {
@@ -244,25 +242,37 @@ export function HolidaysView() {
244242
245243 if ( isLoading ) {
246244 return (
247- < SettingsHeader title = { t ( "holidays" ) } description = { t ( "holidays_description" ) } CTA = { < HolidaysCTA /> } >
248- < SkeletonContainer >
249- < div className = "space-y-4" >
250- < SkeletonText className = "h-10 w-64" />
251- < SkeletonText className = "h-64 w-full" />
252- </ div >
253- </ SkeletonContainer >
245+ < SettingsHeader
246+ title = { t ( "holidays" ) }
247+ description = { t ( "holidays_description" ) }
248+ borderInShellHeader = { true }
249+ CTA = { < HolidaysCTA /> } >
250+ < div className = "border-subtle rounded-b-lg border border-t-0 px-4 py-6 sm:px-6" >
251+ < SkeletonContainer >
252+ < div className = "space-y-4" >
253+ < SkeletonText className = "h-10 w-64" />
254+ < SkeletonText className = "h-64 w-full" />
255+ </ div >
256+ </ SkeletonContainer >
257+ </ div >
254258 </ SettingsHeader >
255259 ) ;
256260 }
257261
258262 if ( hasError ) {
259263 return (
260- < SettingsHeader title = { t ( "holidays" ) } description = { t ( "holidays_description" ) } CTA = { < HolidaysCTA /> } >
261- < Alert
262- severity = "error"
263- title = { t ( "something_went_wrong" ) }
264- message = { countriesError ?. message || settingsError ?. message }
265- />
264+ < SettingsHeader
265+ title = { t ( "holidays" ) }
266+ description = { t ( "holidays_description" ) }
267+ borderInShellHeader = { true }
268+ CTA = { < HolidaysCTA /> } >
269+ < div className = "border-subtle rounded-b-lg border border-t-0 px-4 py-6 sm:px-6" >
270+ < Alert
271+ severity = "error"
272+ title = { t ( "something_went_wrong" ) }
273+ message = { countriesError ?. message || settingsError ?. message }
274+ />
275+ </ div >
266276 </ SettingsHeader >
267277 ) ;
268278 }
@@ -271,57 +281,60 @@ export function HolidaysView() {
271281 < SettingsHeader
272282 title = { t ( "out_of_office" ) }
273283 description = { t ( "out_of_office_description" ) }
284+ borderInShellHeader = { true }
274285 CTA = { < HolidaysCTA /> } >
275- < div className = "space-y-6" >
276- { conflictsData ?. conflicts && conflictsData . conflicts . length > 0 && (
277- < ConflictWarning conflicts = { conflictsData . conflicts } />
278- ) }
286+ < div className = "border-subtle rounded-b-lg border border-t-0 px-4 py-6 sm:px-6" >
287+ < div className = "space-y-6" >
288+ { conflictsData ?. conflicts && conflictsData . conflicts . length > 0 && (
289+ < ConflictWarning conflicts = { conflictsData . conflicts } />
290+ ) }
279291
280- < div className = "border-subtle bg-muted overflow-hidden rounded-lg border p-5" >
281- { /* Header with title and country selector */ }
282- < div className = "mb-4 flex items-center justify-between" >
283- < div >
284- < h3 className = "text-emphasis font-semibold" > { t ( "holidays" ) } </ h3 >
285- < p className = "text-subtle text-sm" > { t ( "holidays_description" ) } </ p >
292+ < div className = "border-subtle bg-muted overflow-hidden rounded-lg border p-5" >
293+ { /* Header with title and country selector */ }
294+ < div className = "mb-4 flex items-center justify-between" >
295+ < div >
296+ < h3 className = "text-emphasis font-semibold" > { t ( "holidays" ) } </ h3 >
297+ < p className = "text-subtle text-sm" > { t ( "holidays_description" ) } </ p >
298+ </ div >
299+ < CountrySelector
300+ countries = { countries || [ ] }
301+ value = { settings ?. countryCode || "" }
302+ onChange = { handleCountryChange }
303+ isLoading = { isLoadingCountries }
304+ />
286305 </ div >
287- < CountrySelector
288- countries = { countries || [ ] }
289- value = { settings ?. countryCode || "" }
290- onChange = { handleCountryChange }
291- isLoading = { isLoadingCountries }
292- />
293- </ div >
294306
295- { /* Holidays list - inner container */ }
296- { settings ?. countryCode ? (
297- < div className = "border-subtle bg-default overflow-hidden rounded-md border" >
298- { settings . holidays && settings . holidays . length > 0 ? (
299- settings . holidays . map ( ( holiday ) => (
300- < HolidayListItem
301- key = { holiday . id }
302- holiday = { holiday }
303- onToggle = { handleToggleHoliday }
304- isToggling = {
305- toggleHolidayMutation . isPending &&
306- toggleHolidayMutation . variables ?. holidayId === holiday . id
307- }
308- />
309- ) )
310- ) : (
311- < div className = "text-subtle py-8 text-center text-sm" >
312- { t ( "no_holidays_found_for_country" ) }
307+ { /* Holidays list - inner container */ }
308+ { settings ?. countryCode ? (
309+ < div className = "border-subtle bg-default overflow-hidden rounded-md border justify-between" >
310+ { settings . holidays && settings . holidays . length > 0 ? (
311+ settings . holidays . map ( ( holiday ) => (
312+ < HolidayListItem
313+ key = { holiday . id }
314+ holiday = { holiday }
315+ onToggle = { handleToggleHoliday }
316+ isToggling = {
317+ toggleHolidayMutation . isPending &&
318+ toggleHolidayMutation . variables ?. holidayId === holiday . id
319+ }
320+ />
321+ ) )
322+ ) : (
323+ < div className = "text-subtle py-8 text-center text-sm" >
324+ { t ( "no_holidays_found_for_country" ) }
325+ </ div >
326+ ) }
327+ </ div >
328+ ) : (
329+ < div className = "bg-default flex flex-col items-center rounded-md py-14 text-center" >
330+ < div className = "bg-emphasis mb-4 flex h-16 w-16 items-center justify-center rounded-full" >
331+ < Icon name = "calendar" className = "text-default h-8 w-8" />
313332 </ div >
314- ) }
315- </ div >
316- ) : (
317- < div className = "bg-default flex flex-col items-center rounded-md py-14 text-center" >
318- < div className = "bg-emphasis mb-4 flex h-16 w-16 items-center justify-center rounded-full" >
319- < CalendarIcon className = "text-default h-8 w-8" />
333+ < h4 className = "text-emphasis mb-1 font-medium" > { t ( "no_holidays_selected" ) } </ h4 >
334+ < p className = "text-subtle text-sm" > { t ( "select_country_to_see_holidays" ) } </ p >
320335 </ div >
321- < h4 className = "text-emphasis mb-1 font-medium" > { t ( "no_holidays_selected" ) } </ h4 >
322- < p className = "text-subtle text-sm" > { t ( "select_country_to_see_holidays" ) } </ p >
323- </ div >
324- ) }
336+ ) }
337+ </ div >
325338 </ div >
326339 </ div >
327340 </ SettingsHeader >
0 commit comments