Skip to content

Commit 1acf700

Browse files
committed
feat: add PerformersSectionButton component with tooltip and skeleton loading
Signed-off-by: Amit Amrutiya <[email protected]>
1 parent df16133 commit 1acf700

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import React from 'react';
2+
import { Button, Skeleton } from '../../base';
3+
import { TropyIcon } from '../../icons';
4+
import { useTheme } from '../../theme';
5+
import { CustomTooltip } from '../CustomTooltip';
6+
import { CardSkeleton } from './styles';
7+
8+
interface PerformersSectionButtonProps {
9+
open: boolean;
10+
handleClick: () => void;
11+
}
12+
13+
const PerformersSectionButton: React.FC<PerformersSectionButtonProps> = ({ open, handleClick }) => {
14+
const theme = useTheme();
15+
16+
return (
17+
<CustomTooltip title={open ? 'Hide Performers' : 'Show Performers'} placement="bottom">
18+
<span>
19+
<Button
20+
variant="contained"
21+
onClick={handleClick}
22+
sx={{
23+
height: '3.7rem',
24+
padding: '0rem'
25+
}}
26+
style={{
27+
backgroundColor: open ? undefined : theme.palette.background.constant?.disabled
28+
}}
29+
>
30+
<TropyIcon style={{ height: '2rem', width: '2rem' }} />
31+
</Button>
32+
</span>
33+
</CustomTooltip>
34+
);
35+
};
36+
37+
export const StateCardSekeleton = () => {
38+
return (
39+
<CardSkeleton>
40+
{[...Array(5)].map((_, index) => (
41+
<Skeleton
42+
key={index}
43+
variant={'rounded'}
44+
height={'13.5rem'}
45+
width={'inherit'}
46+
sx={{
47+
minWidth: '150px'
48+
}}
49+
style={{ borderRadius: '1rem' }}
50+
/>
51+
))}
52+
</CardSkeleton>
53+
);
54+
};
55+
export default PerformersSectionButton;

0 commit comments

Comments
 (0)