nitin
2025-03-10 19:02:40 +05:30
committed by GitHub
parent a1e0d7b7d7
commit 77574594f2
29 changed files with 496 additions and 212 deletions

View File

@ -42,10 +42,12 @@ type SettingsListCardProps<ListItem extends { id: string }> = {
onRowClick?: (item: ListItem) => void;
RowIcon?: IconComponent;
RowIconFn?: (item: ListItem) => IconComponent;
RowIconColor?: string;
RowRightComponent: ComponentType<{ item: ListItem }>;
footerButtonLabel?: string;
onFooterButtonClick?: () => void;
to?: (item: ListItem) => string;
rounded?: boolean;
};
export const SettingsListCard = <
@ -61,21 +63,24 @@ export const SettingsListCard = <
onRowClick,
RowIcon,
RowIconFn,
RowIconColor,
RowRightComponent,
onFooterButtonClick,
footerButtonLabel,
to,
rounded,
}: SettingsListCardProps<ListItem>) => {
const theme = useTheme();
if (isLoading === true) return <SettingsListSkeletonCard />;
return (
<Card>
<Card rounded={rounded}>
{items.map((item, index) => (
<SettingsListItemCardContent
key={item.id}
LeftIcon={RowIconFn ? RowIconFn(item) : RowIcon}
LeftIconColor={RowIconColor}
label={getItemLabel(item)}
description={getItemDescription?.(item)}
rightComponent={<RowRightComponent item={item} />}