28 lines
716 B
TypeScript
28 lines
716 B
TypeScript
import { View } from "react-native";
|
|
import { styles } from "./SelectButtonStyles";
|
|
import { SelectButtonType } from "../../../App/common/constants";
|
|
|
|
interface SelectButtonProps {
|
|
selected?: boolean;
|
|
type?: string;
|
|
}
|
|
|
|
const RadioButton = ({ selected }: SelectButtonProps) => {
|
|
return (
|
|
<View style={[styles.radioButton, selected && styles.selectedRadioButton]}>
|
|
{selected && <View style={styles.innerRadio} />}
|
|
</View>
|
|
);
|
|
};
|
|
|
|
const SelectButton = ({ selected, type }: SelectButtonProps) => {
|
|
switch (type) {
|
|
case SelectButtonType.RADIO:
|
|
return <RadioButton selected={selected} />;
|
|
default:
|
|
return <RadioButton selected={selected} />;
|
|
}
|
|
};
|
|
|
|
export default SelectButton;
|