import { router } from "expo-router";
import { Image, StyleSheet, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { t } from "../../lib/locales";
import { colors } from "../../lib/theme";
import { Button, H1, Muted } from "../../lib/ui";

import dogLogo from "../../assets/images/dog-logo.png";

export default function Welcome() {
  return (
    <SafeAreaView style={styles.container}>
      <View style={styles.content}>
        <View style={styles.hero}>
          <View style={styles.iconContainer}>
            <Image source={dogLogo} style={{ width: 100, height: 100 }} />
          </View>
          <H1>{t("welcomeTitle")}</H1>
          <Muted style={styles.subtitle}>{t("welcomeSubtitle")}</Muted>
        </View>

        <View style={styles.actions}>
          <Button
            title={t("getStarted")}
            onPress={() => router.push("/(auth)/signup")}
          />
          <Button
            title={t("signIn")}
            variant="secondary"
            onPress={() => router.push("/(auth)/signin")}
          />
        </View>
      </View>
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: colors.background,
  },
  content: {
    flex: 1,
    padding: 24,
    justifyContent: "space-between",
  },
  hero: {
    flex: 1,
    alignItems: "center",
    justifyContent: "center",
    gap: 16,
  },
  iconContainer: {
    marginBottom: 24,
  },
  subtitle: {
    textAlign: "center",
    paddingHorizontal: 20,
  },
  actions: {
    gap: 12,
  },
});
