import { Ionicons } from "@expo/vector-icons";
import { useCallback } from "react";
import { FlatList, StyleSheet, Text, View } from "react-native";
import { IoniconsType } from "../../lib/types";
import { TabButton } from "./TabButton";
export type TabSectionItem = {
onPress: () => void;
icon: IoniconsType;
title: string;
};
export type TabSectionColor = { bg: string; text: string };
const COLORS: TabSectionColor[] = [
{ bg: "bg-blue-500", text: "text-blue-600" },
{ bg: "bg-emerald-500", text: "text-emerald-600" },
{ bg: "bg-violet-500", text: "text-violet-600" },
{ bg: "bg-amber-500", text: "text-amber-600" },
{ bg: "bg-rose-500", text: "text-rose-600" },
{ bg: "bg-slate-500", text: "text-slate-600" },
];
export function TabSection({
itemHeight = 150,
items,
colors = COLORS,
}: {
itemHeight?: number;
items: TabSectionItem[];
colors?: TabSectionColor[];
}) {
const renderGridItem = useCallback(
({ item, index }: { item: TabSectionItem; index: number }) => (
{item.title}
),
[]
);
return (
item.title}
columnWrapperStyle={styles.columnWrapper}
contentContainerStyle={styles.contentContainer}
/>
);
}
const styles = StyleSheet.create({
columnWrapper: {
gap: 16,
paddingHorizontal: 16,
},
contentContainer: {
gap: 16,
paddingVertical: 16,
},
});