/* eslint-disable react-hooks/rules-of-hooks */ import { Button, Paper, Tab, Typography } from '@mui/material'; import { grey } from '@mui/material/colors'; import { useState } from 'react'; import { makeStyles } from 'tss-react/mui'; import { SearchField } from '..'; import Listing from '../Listing'; import { ColumnType } from '../Listing/models'; import Panel from '../Panel'; import ListingPage, { type ListingPageProps } from '.'; import Filter from './Filter'; import '../ThemeProvider/tailwindcss.css'; export default { title: 'Listing Page' }; const useStyles = makeStyles()((theme) => ({ autoComplete: { width: 250 }, comment: { gridArea: 'comment' }, description: { gridArea: 'description' }, detailsContent: { display: 'grid', gridGap: theme.spacing(2), gridTemplateAreas: ` 'title title' 'description comment' `, gridTemplateRows: '50px 100px' }, detailsPanel: { display: 'grid', gridGap: theme.spacing(4), gridTemplateColumns: '94%', gridTemplateRows: 'auto 1fr', justifyContent: 'center', marginTop: theme.spacing(2) }, detailsPanelHeader: { display: 'grid', gridGap: theme.spacing(2), gridTemplateColumns: 'auto min-content', justifyItems: 'center', margin: '0 auto', width: '95%' }, filterSummary: { alignItems: 'center', display: 'grid', gridGap: theme.spacing(2), gridTemplateColumns: 'auto auto 1fr' }, page: { height: '100vh' }, title: { alignItems: 'center', gridArea: 'title', textAlign: 'center' } })); const columns = [ { getFormattedString: ({ name }): string => name, id: 'name', label: 'Name', type: ColumnType.string }, { getFormattedString: ({ description }): string => description, id: 'description', label: 'Description', type: ColumnType.string }, { getFormattedString: ({ alias }): string => alias, id: 'alias', label: 'Alias', type: ColumnType.string } ]; const twentyFiveElements = new Array(25).fill(0); const elements = [...twentyFiveElements].map((_, index) => ({ active: index % 2 === 0, alias: `Alias ${index}`, description: `Entity ${index}`, id: index, name: `E${index}` })); const rowColorConditions = [ { color: grey[500], condition: ({ active }): boolean => !active, name: 'inactive' } ]; const listing = (