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

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

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

export default BrainDumpItem;
