import { StyleSheet } from "react-native";
import { ThemedText } from "./themed-text";
import { useThemeColor } from "@/hooks/use-theme-color";

interface ThemedErrorProps {
  children?: string | null;
}

export const ThemedError = ({ children }: ThemedErrorProps) => {
  const textColor = useThemeColor({}, "red");

  return children ? (
    <ThemedText
      type="small"
      style={styles.text}
      lightColor={textColor}
      darkColor={textColor}
    >
      {children}
    </ThemedText>
  ) : null;
};

const styles = StyleSheet.create({
  container: {},
  text: {},
});
