1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-06 00:07:44 +01:00
unleash.unleash/frontend/src/component/admin/banners/BannersTable/BannersActionsCell.tsx
Nuno Góis 667aed828b
feat: banners admin page (#5111)
https://linear.app/unleash/issue/2-1484/ui-create-an-admin-banners-configuration-page

Adds a new "Banners" page to the admin UI.
This first iteration allows admins to list and preview all configured
message banners, toggle them (whether they are currently visible to all
users or not), and remove them.

Next step will be creating the modal for "new" and "edit" operations.

### Admin menu

![image](https://github.com/Unleash/unleash/assets/14320932/39bcf575-b03a-481b-b19e-fc87697ed51c)

### Banners page

![image](https://github.com/Unleash/unleash/assets/14320932/39df6bc2-6949-4956-9dd0-0e5b1d2959f6)
2023-10-20 11:14:48 +01:00

45 lines
1.2 KiB
TypeScript

import { Delete, Edit } from '@mui/icons-material';
import { Box, styled } from '@mui/material';
import PermissionIconButton from 'component/common/PermissionIconButton/PermissionIconButton';
import { ADMIN } from 'component/providers/AccessProvider/permissions';
const StyledBox = styled(Box)(() => ({
display: 'flex',
justifyContent: 'center',
}));
interface IBannersActionsCellProps {
onEdit: (event: React.SyntheticEvent) => void;
onDelete: (event: React.SyntheticEvent) => void;
}
export const BannersActionsCell = ({
onEdit,
onDelete,
}: IBannersActionsCellProps) => {
return (
<StyledBox>
<PermissionIconButton
data-loading
onClick={onEdit}
permission={ADMIN}
tooltipProps={{
title: 'Edit banner',
}}
>
<Edit />
</PermissionIconButton>
<PermissionIconButton
data-loading
onClick={onDelete}
permission={ADMIN}
tooltipProps={{
title: 'Remove banner',
}}
>
<Delete />
</PermissionIconButton>
</StyledBox>
);
};