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B,SAAS,EAAG,YAAa,CACvDrB,OAAQE,CACV,GAAI,IAAI,IACN,IACDiB,CAAAA,EAAAA,EAAAA,EAAAA,EAAO,IAAIC,KAAKrB,EAAeuB,OAAO,EAAG,YAAa,CACrDtB,OAAQE,CACV,WAIN,GAAAjB,EAAAM,GAAA,EAACJ,MAAAA,CAAIC,UAAU,uBACb,GAAAH,EAAAM,GAAA,EAACgC,EAAIA,CAACrE,SAAS,SAASD,OAAQ8C,EAAezB,EAAE,YAM7D,qICjFA,IAAMkD,EAAsC,CAC1CC,GAAIA,EAAAA,EAAEA,CACNC,GAAIC,EAAAA,CAAIA,CACRC,GAAIA,EAAAA,EAAEA,CACNC,GAAIA,EAAAA,EAAEA,CACNC,GAAIA,EAAAA,EAAEA,CACNC,GAAIA,EAAAA,EAAEA,EAGD,SAAS5B,EAAU6B,CAAmB,EAE3C,OAAOR,CAAO,CAACQ,EAAyB,EAAIL,EAAAA,CAAIA,AAClD","sources":["webpack://_N_E/?afb8","webpack://_N_E/./node_modules/next/dist/api/navigation.js","webpack://_N_E/./src/components/molecules/Like/Like.tsx","webpack://_N_E/./src/app/[locale]/league/[leagueId]/LeagueInfo.tsx","webpack://_N_E/./src/hooks/useLocale.ts","webpack://_N_E/./src/app/[locale]/league/_league.scss","webpack://_N_E/./src/components/molecules/Like/_like.scss"],"sourcesContent":["import(/* webpackMode: \"eager\" */ \"/codebuild/output/src1751503179/src/football-trends-face/src/app/[locale]/league/_league.scss\");\n;\nimport(/* webpackMode: \"eager\", webpackExports: [\"default\"] */ \"/codebuild/output/src1751503179/src/football-trends-face/src/app/[locale]/league/[leagueId]/LeagueInfo.tsx\");\n","export * from \"../client/components/navigation\";\n\n//# sourceMappingURL=navigation.js.map","'use client';\nimport { useState, useEffect } from 'react';\nimport { useTheme } from 'next-themes';\nimport Image from 'next/image';\n\nimport \"./_like.scss\"\n\ninterface LikeProps {\n itemId: number;\n itemType: string;\n}\n\nconst Like = ({ itemId, itemType }: LikeProps) => {\n const { theme } = useTheme();\n const [isLiked, setIsLiked] = useState(false);\n const storageKey = `${itemType}-likes`;\n\n useEffect(() => {\n const likes = JSON.parse(localStorage.getItem(storageKey) || '[]');\n setIsLiked(likes.includes(itemId));\n }, [itemId, storageKey]);\n\n const handleLike = async () => {\n const likes = JSON.parse(localStorage.getItem(storageKey) || '[]');\n const isNowLiked = !isLiked;\n const updatedLikes = isNowLiked\n ? [...likes, itemId]\n : likes.filter((id: number) => id !== itemId);\n\n setIsLiked(isNowLiked);\n localStorage.setItem(storageKey, JSON.stringify(updatedLikes));\n\n try {\n const method = isNowLiked ? 'POST' : 'DELETE';\n const response = await fetch(`/api/community/like/${itemType}`, {\n method,\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ itemId }),\n });\n\n if (!response.ok) {\n console.error('Failed to update like status on the server');\n setIsLiked(!isNowLiked);\n localStorage.setItem(storageKey, JSON.stringify(likes));\n }\n } catch (error) {\n console.error('Network error:', error);\n setIsLiked(!isNowLiked);\n localStorage.setItem(storageKey, JSON.stringify(likes));\n }\n };\n\n return (\n \n {isLiked ? (\n \n ) : (\n \n )}\n {isLiked && (\n <>\n
\n
\n
\n
\n
\n
\n \n )}\n \n );\n};\n\nexport default Like;\n","\"use client\";\n\nimport React from \"react\";\nimport Image from \"next/image\";\nimport { format } from \"date-fns\";\nimport { useParams } from \"next/navigation\";\nimport { useLocale } from \"@/hooks/useLocale\";\nimport Like from \"@/components/molecules/Like/Like\";\nimport { League } from \"@/types/league\";\n\ninterface LeagueInfoProps {\n selectedLeague: League;\n}\n\nconst LeagueInfo: React.FC = ({ selectedLeague }) => {\n const params = useParams();\n const { locale } = params;\n const dateFnsLocale = useLocale(locale as string);\n\n return (\n
\n
\n
\n
\n \n {selectedLeague.logo && (\n \n )}\n
\n
\n \n

\n {selectedLeague.name}\n

\n
\n {selectedLeague.countryFlag && (\n \n )}\n

 {selectedLeague.countryName}

\n
\n
\n {format(new Date(selectedLeague.startdate), \"dd MMM yy\", {\n locale: dateFnsLocale,\n })}{\" \"}\n -{\" \"}\n {format(new Date(selectedLeague.enddate), \"dd MMM yy\", {\n locale: dateFnsLocale,\n })}\n
\n
\n
\n
\n \n
\n \n \n \n );\n};\n\nexport default LeagueInfo;\n","import { es, enUS, it, fr, de, pt } from 'date-fns/locale';\nimport { Locale } from 'date-fns';\n\ntype LocaleKey = 'es' | 'en' | 'it' | 'fr' | 'de' | 'pt';\n\nconst locales: Record = {\n es: es,\n en: enUS,\n it: it,\n fr: fr,\n de: de,\n pt: pt,\n};\n\nexport function useLocale(localeParam: string): Locale {\n // Asegurarse de que el localeParam sea un LocaleKey o retornar un valor por defecto\n return locales[localeParam as LocaleKey] || enUS;\n}","// extracted by mini-css-extract-plugin","// extracted by mini-css-extract-plugin"],"names":["Promise","resolve","then","__webpack_require__","t","bind","Like_Like","itemId","itemType","param","theme","useTheme","isLiked","setIsLiked","useState","storageKey","concat","useEffect","likes","parse","localStorage","getItem","includes","handleLike","JSON","isNowLiked","updatedLikes","filter","id","setItem","stringify","response","fetch","method","headers","body","ok","console","error","jsx_runtime","jsxs","div","className","onClick","aria-label","jsx","Image","src","alt","width","height","Fragment","_leagueId_LeagueInfo","selectedLeague","locale","useParams","dateFnsLocale","useLocale","style","backgroundImage","logo","countryFlag","minHeight","backgroundColor","borderRadius","h1","strong","name","countryCode","toLowerCase","countryName","h3","h6","format","Date","startdate","enddate","Like","locales","es","en","enUS","it","fr","de","pt","localeParam"],"sourceRoot":""}