Files
super-app/components/reusable/select-button/SelectButton.tsx
Mayank Singh 9527976c41 TP-64336 | Multi plan feature (#10813)
Co-authored-by: sangaraboinarishvik <rishvik.vardhan@navi.com>
2024-05-14 18:10:14 +00:00

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;