import { View, Text } from "react-native-ui-lib";
import React, { useState } from "react";
import { IBrainDump } from "@/contexts/DumpContext";
import { TouchableOpacity } from "react-native-gesture-handler";
import MoveBrainDump from "./MoveBrainDump";

const BrainDumpItem = (props: { item: IBrainDump }) => {
  const [isVisible, setIsVisible] = useState<boolean>(false);

  return (
    <View>
      <TouchableOpacity onPress={() => setIsVisible(true)}>
        <View
          backgroundColor="white"
          marginV-5
          padding-15
          style={{ borderRadius: 20, elevation: 2 }}
        >
          <Text text70BL marginB-8>
            {props.item.title}
          </Text>
          <Text text80>{props.item.description}</Text>
        </View>
      </TouchableOpacity>
      <MoveBrainDump item={props.item} isVisible={isVisible} setIsVisible={setIsVisible} />
    </View>
  );
};

export default BrainDumpItem;
