import { Tabs } from "expo-router";
import React from "react";
import { useTranslation } from "react-i18next";

import CustomTabBar from "@/components/custom-tab-bar";
import { IconSymbol } from "@/components/ui/icon-symbol";

export default function TabLayout() {
  const { t } = useTranslation();

  return (
    <Tabs
      tabBar={(props) => <CustomTabBar {...props} />}
      screenOptions={{
        headerShown: false,
      }}
    >
      <Tabs.Screen
        name="index"
        options={{
          title: t("tabs.all"),
          tabBarIcon: ({ color }) => (
            <IconSymbol size={28} name="list" color={color} />
          ),
        }}
      />
      <Tabs.Screen
        name="live"
        options={{
          title: t("tabs.live"),
          tabBarIcon: ({ color }) => (
            <IconSymbol size={28} name="play-circle" color={color} />
          ),
        }}
      />
      <Tabs.Screen
        name="upcoming"
        options={{
          title: t("tabs.upcoming"),
          tabBarIcon: ({ color }) => (
            <IconSymbol size={28} name="calendar" color={color} />
          ),
        }}
      />
      <Tabs.Screen
        name="finished"
        options={{
          title: t("tabs.finished"),
          tabBarIcon: ({ color }) => (
            <IconSymbol size={28} name="checkmark-circle" color={color} />
          ),
        }}
      />
      <Tabs.Screen
        name="favorite"
        options={{
          title: t("tabs.fav"),
          tabBarIcon: ({ color }) => (
            <IconSymbol size={28} name="star" color={color} />
          ),
        }}
      />
    </Tabs>
  );
}
