import { Text, View, Button } from "react-native";
import React, {useState} from 'react';
import { ThemedText } from "@/components/ThemedText"
import Blurb, {BlurbData} from "@/components/Blurb"

const default_blurb: BlurbData = {
  title: "Fart Man Comes To Town!",
  blurb: "Will this controversial figure finally cause the downfall of the town? Sally Smith from town center says that she can already smell trouble brewing but other members of the town believe the imminent winds of change will revitalize the towns central business district."
};

export default function Index() {
  const [blurbs, setBlurbs] = useState([default_blurb])
  return (
    <View
      style={{
        flex: 1,
        justifyContent: "center",
        alignItems: "center",
      }}
    >
      {blurbs.map((blurb, i) => (
        <Blurb key={i} {...blurb} />
      ))}
      <Button 
        onPress={() => {
          setBlurbs(blurbs.concat([default_blurb]));
        }}
        title="Load More"
      />
    </View>
  );
}

