import { format } from "date-fns";
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import { useCalendarContext } from "./context";
export function DayLabels({ daysOfWeek }: { daysOfWeek: Date[] }) {
return (
{daysOfWeek.map((day) => (
))}
);
}
export function DayLabel({ day }: { day: Date }) {
const { DayLabelComponent, theme } = useCalendarContext();
const dayLabelText = format(day, theme.dayLabelDateFormat);
return DayLabelComponent ? (
) : (
{dayLabelText}
);
}
const styles = StyleSheet.create({
row: {
flexDirection: "row",
},
dayLabelContainer: {
flex: 1,
justifyContent: "center",
alignItems: "center",
},
dayLabelRow: {
flex: 1,
flexDirection: "row",
justifyContent: "space-between",
paddingVertical: 10,
},
});