import * as React from "react" ; import { ButtonProps } from "./utils" ; import { PrimaryButton } from "./primary-button" ; import { OutlineButton } from "./outline-button" ; interface OptionBaseProps { selected ? : boolean ; } export type OptionButtonProps = OptionBaseProps & ButtonProps ; link export const OptionButton = React . forwardRef < HTMLOptionElement , OptionButtonProps > ( ( { className , style , type , block , size = "md" , color = "silacak" , rounded , icon , iconPosition = "left" , isLoading , loadingText = "Memuat..." , disabled , children , selected , ... rest } , _ref ) => { if ( selected ) { return ( < PrimaryButton block = { block } className = { className } color = { color } disabled = { disabled } icon = { icon } iconPosition = { iconPosition } isLoading = { isLoading } loadingText = { loadingText } rounded = { rounded } size = { size } style = { style } type = { type } { ... rest } > { children } < /PrimaryButton>); } return ( < OutlineButton block = { block } className = { className } color = { color } disabled = { disabled } icon = { icon } iconPosition = { iconPosition } isLoading = { isLoading } loadingText = { loadingText } rounded = { rounded } size = { size } style = { style } type = { type } { ... rest } > { children } < /OutlineButton>); } ) ; OptionButton . displayName = "OptionButton" ;