Files
twenty/packages/twenty-front/src/modules/information-banner/components/InformationBanner.tsx
Jérémy M db54469c8a feat: soft delete (#6576)
Implement soft delete on standards and custom objects.
This is a temporary solution, when we drop `pg_graphql` we should rely
on the `softDelete` functions of TypeORM.

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2024-08-16 21:20:02 +02:00

44 lines
952 B
TypeScript

import { Button } from '@/ui/input/button/components/Button';
import styled from '@emotion/styled';
import { Banner, BannerVariant, IconComponent } from 'twenty-ui';
const StyledBanner = styled(Banner)`
position: absolute;
`;
const StyledText = styled.div`
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`;
export const InformationBanner = ({
message,
variant = 'default',
buttonTitle,
buttonIcon,
buttonOnClick,
}: {
message: string;
variant?: BannerVariant;
buttonTitle?: string;
buttonIcon?: IconComponent;
buttonOnClick?: () => void;
}) => {
return (
<StyledBanner variant={variant}>
<StyledText>{message}</StyledText>
{buttonTitle && buttonOnClick && (
<Button
variant="secondary"
title={buttonTitle}
Icon={buttonIcon}
size="small"
inverted
onClick={buttonOnClick}
/>
)}
</StyledBanner>
);
};