7abc67c905
Removed redundant handleSave and handleSubmit props in domain settings. Integrated form submission logic directly into form components, ensuring consistent behavior and reducing complexity. Updated button components to explicitly support the "type" attribute for improved accessibility and functionality. --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import styled from '@emotion/styled';
|
|
import { IconComponent } from 'twenty-ui';
|
|
import { SettingsRadioCard } from '@/settings/components/SettingsRadioCard';
|
|
|
|
const StyledRadioCardContainer = styled.div`
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: ${({ theme }) => theme.spacing(4)};
|
|
`;
|
|
|
|
type SettingsRadioCardContainerProps = {
|
|
onChange: (value: string) => void;
|
|
value: string;
|
|
options: Array<{
|
|
value: string;
|
|
title: string;
|
|
description?: string;
|
|
Icon?: IconComponent;
|
|
}>;
|
|
};
|
|
|
|
export const SettingsRadioCardContainer = ({
|
|
options,
|
|
value,
|
|
onChange,
|
|
}: SettingsRadioCardContainerProps) => {
|
|
return (
|
|
<StyledRadioCardContainer role="radiogroup">
|
|
{options.map((option) => (
|
|
<SettingsRadioCard
|
|
key={option.value}
|
|
role="radio"
|
|
value={option.value}
|
|
isSelected={value === option.value}
|
|
handleSelect={onChange}
|
|
title={option.title}
|
|
description={option.description}
|
|
Icon={option.Icon}
|
|
ariaChecked={value === option.value}
|
|
/>
|
|
))}
|
|
</StyledRadioCardContainer>
|
|
);
|
|
};
|