import React from "react";
import { View, StyleSheet, ScrollView } from "react-native";
import {
  useNavigation,
  NavigationProp,
  NavigationContainer,
} from "@react-navigation/native";
import Header from "../components/header/Header";
import ButtonFooter from "../components/footer/ButtonFooter";

type Props = {
  children: React.ReactNode;
  activeTab: string;
};

const AppLayout = ({ children, activeTab }: Props) => {
  const navigation = useNavigation<NavigationProp<any>>();

  return (
    <View style={styles.container}>
      <Header />
      <View style={styles.content}>{children}</View>
      <ButtonFooter navigation={navigation} activeTab={activeTab} />
    </View>
  );
};

export default AppLayout;

const styles = StyleSheet.create({
  container: {
    marginLeft: "auto",
    marginRight: "auto",
    maxWidth: 480,
    flex: 1,
    backgroundColor: "#fff",
  },
  content: {
    flex: 1,
  },
});
