This PR was created by [GitStart](https://gitstart.com/) to address the requirements from this ticket: [TWNTY-7532](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7532). --- ### Description Migrate: - Card - CardContent - CardFooter - CardHeader ### Demo Card in Storybook  ###### Fixes twentyhq/private-issues#86 --------- Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: Charles Bochet <charles@twenty.com>
36 lines
900 B
TypeScript
36 lines
900 B
TypeScript
import styled from '@emotion/styled';
|
|
import { CardContent } from 'twenty-ui';
|
|
import React from 'react';
|
|
|
|
const StyledRowContent = styled(CardContent)<{
|
|
clickable?: boolean;
|
|
}>`
|
|
align-items: center;
|
|
display: flex;
|
|
gap: ${({ theme }) => theme.spacing(2)};
|
|
height: ${({ theme }) => theme.spacing(12)};
|
|
padding: ${({ theme }) => theme.spacing(0, 4)};
|
|
cursor: ${({ clickable }) => (clickable === true ? 'pointer' : 'default')};
|
|
`;
|
|
|
|
export const ActivityRow = ({
|
|
children,
|
|
onClick,
|
|
disabled,
|
|
}: React.PropsWithChildren<{
|
|
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
disabled?: boolean;
|
|
}>) => {
|
|
const handleClick = (event: React.MouseEvent<HTMLDivElement>) => {
|
|
if (disabled !== true) {
|
|
onClick?.(event);
|
|
}
|
|
};
|
|
|
|
return (
|
|
<StyledRowContent onClick={handleClick} clickable={disabled !== true}>
|
|
{children}
|
|
</StyledRowContent>
|
|
);
|
|
};
|