CalendarHeader.tsx 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. "use client";
  2. import { CalendarDays } from "lucide-react";
  3. import { COLOR_PALETTE } from "@/utils/palette";
  4. import { format } from "date-fns";
  5. import { es } from "date-fns/locale";
  6. interface CalendarHeaderProps {
  7. selectedDate: Date;
  8. totalAppointments: number;
  9. }
  10. export function CalendarHeader({ selectedDate, totalAppointments }: CalendarHeaderProps) {
  11. return (
  12. <div className="bg-white rounded-lg shadow-sm border border-gray-200 p-6">
  13. <div className="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4">
  14. <div className="flex items-center gap-3 flex-1">
  15. <div
  16. className="p-3 rounded-lg flex-shrink-0"
  17. style={{ backgroundColor: COLOR_PALETTE.primary[50] }}
  18. >
  19. <CalendarDays
  20. className="h-6 w-6"
  21. style={{ color: COLOR_PALETTE.primary[600] }}
  22. />
  23. </div>
  24. <div>
  25. <h1
  26. className="text-2xl font-bold"
  27. style={{ color: COLOR_PALETTE.gray[900] }}
  28. >
  29. Calendario de Citas
  30. </h1>
  31. <p
  32. className="text-sm mt-1"
  33. style={{ color: COLOR_PALETTE.gray[500] }}
  34. >
  35. Gestiona y visualiza todas tus citas médicas
  36. </p>
  37. </div>
  38. </div>
  39. <div className="flex items-center gap-4 flex-shrink-0">
  40. <div
  41. className="text-right px-4 py-3 rounded-lg border"
  42. style={{
  43. backgroundColor: COLOR_PALETTE.primary[50],
  44. borderColor: COLOR_PALETTE.primary[200]
  45. }}
  46. >
  47. <div
  48. className="text-2xl font-bold"
  49. style={{ color: COLOR_PALETTE.primary[700] }}
  50. >
  51. {totalAppointments}
  52. </div>
  53. <div
  54. className="text-xs font-medium"
  55. style={{ color: COLOR_PALETTE.primary[600] }}
  56. >
  57. Citas del mes
  58. </div>
  59. </div>
  60. <div
  61. className="text-right px-4 py-3 rounded-lg border"
  62. style={{
  63. backgroundColor: COLOR_PALETTE.gray[50],
  64. borderColor: COLOR_PALETTE.gray[200]
  65. }}
  66. >
  67. <div
  68. className="text-sm font-semibold"
  69. style={{ color: COLOR_PALETTE.gray[900] }}
  70. >
  71. {format(selectedDate, "MMMM", { locale: es })}
  72. </div>
  73. <div
  74. className="text-xs"
  75. style={{ color: COLOR_PALETTE.gray[600] }}
  76. >
  77. {format(selectedDate, "yyyy", { locale: es })}
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. );
  84. }