diff --git a/frontend/src/component/insights/componentsStat/UserSeats/UserSeats.test.tsx b/frontend/src/component/insights/componentsStat/UserSeats/UserSeats.test.tsx deleted file mode 100644 index eb2835963660..000000000000 --- a/frontend/src/component/insights/componentsStat/UserSeats/UserSeats.test.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { testServerRoute, testServerSetup } from '../../../../utils/testServer'; -import { screen } from '@testing-library/react'; -import { render } from 'utils/testRenderer'; -import { UserSeats } from './UserSeats'; -import { BILLING_PRO_DEFAULT_INCLUDED_SEATS } from 'component/admin/billing/BillingDashboard/BillingPlan/BillingPlan'; - -const server = testServerSetup(); -const user1 = {}; -const user2 = {}; - -const setupApi = () => { - testServerRoute(server, '/api/admin/user-admin', { - users: [user1, user2], - }); - testServerRoute(server, '/api/admin/ui-config', { - flags: { - UNLEASH_CLOUD: true, - }, - }); -}; - -test('User seats display when seats are available', async () => { - setupApi(); - - render(); - - await screen.findByText('User seats'); - await screen.findByText( - `2/${BILLING_PRO_DEFAULT_INCLUDED_SEATS} seats used`, - ); -}); diff --git a/frontend/src/component/insights/componentsStat/UserSeats/UserSeats.tsx b/frontend/src/component/insights/componentsStat/UserSeats/UserSeats.tsx deleted file mode 100644 index 5817eec4ee23..000000000000 --- a/frontend/src/component/insights/componentsStat/UserSeats/UserSeats.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import LicenseIcon from '@mui/icons-material/ReceiptLongOutlined'; -import { Box, styled, Typography } from '@mui/material'; -import LinearProgress from '@mui/material/LinearProgress'; -import { useUsers } from 'hooks/api/getters/useUsers/useUsers'; -import { BILLING_PRO_DEFAULT_INCLUDED_SEATS } from 'component/admin/billing/BillingDashboard/BillingPlan/BillingPlan'; - -const SeatsUsageBar = styled(LinearProgress)(({ theme }) => ({ - marginTop: theme.spacing(0.5), - height: theme.spacing(0.5), - borderRadius: theme.shape.borderRadiusMedium, -})); - -const TotalSeatsRow = styled(Box)(({ theme }) => ({ - display: 'flex', - gap: 1, - alignItems: 'center', -})); - -const TotalSeats = styled(Typography)(({ theme }) => ({ - fontWeight: theme.typography.fontWeightBold, - fontSize: theme.typography.h1.fontSize, - color: theme.palette.primary.main, -})); - -const SeatsUsageRow = styled(Box)(({ theme }) => ({ - marginTop: theme.spacing(2), -})); - -const SeatsUsageText = styled(Box)(({ theme }) => ({ - textAlign: 'right', -})); - -export const UserSeats = () => { - const { users } = useUsers(); - const seats = BILLING_PRO_DEFAULT_INCLUDED_SEATS; - - if (typeof seats === 'number') { - const percentageSeats = Math.floor((users.length / seats) * 100); - - return ( - - - - User seats - {seats} - - - - {users.length}/{seats} seats used - - - - - ); - } - - return null; -};