Files
jrshikoku/components/atom/SwitchArea.tsx
harukin-expo-dev-env e8a2547ca4 tsx化
2025-12-05 10:43:57 +00:00

59 lines
1.2 KiB
TypeScript

import { View, Text, Image, TouchableOpacity } from "react-native";
import { SimpleSwitch } from "./SimpleSwitch";
export const SwitchArea = ({
str,
bool,
setBool,
falseImage,
trueImage,
falseText,
trueText,
falseValue = false,
trueValue = true,
children,
}) => {
return (
<View
style={{
flexDirection: "column",
padding: 10,
backgroundColor: "#00000010",
borderRadius: 10,
margin: 5,
}}
>
<Text
style={{
fontSize: 25,
alignItems: "center",
alignContent: "center",
textAlign: "center",
textAlignVertical: "center",
fontWeight: "bold",
}}
>
{str}
</Text>
<View style={{ flexDirection: "row", padding: 10 }}>
<SimpleSwitch
bool={bool}
setBool={setBool}
color="red"
value={falseValue}
image={falseImage}
subText={falseText}
/>
<SimpleSwitch
bool={bool}
setBool={setBool}
color="red"
value={trueValue}
image={trueImage}
subText={trueText}
/>
</View>
{bool == "true" && children}
</View>
);
};