2024-10-15 09:14:04 +02:00
|
|
|
import { IconButton, styled, Tooltip, Typography } from '@mui/material';
|
2024-10-23 16:59:02 +02:00
|
|
|
import { ReactComponent as AIIcon } from 'assets/icons/AI.svg';
|
2024-10-15 09:14:04 +02:00
|
|
|
import EditNoteIcon from '@mui/icons-material/EditNote';
|
|
|
|
import CloseIcon from '@mui/icons-material/Close';
|
|
|
|
|
|
|
|
const StyledHeader = styled('div')(({ theme }) => ({
|
2024-10-23 16:59:02 +02:00
|
|
|
background:
|
|
|
|
theme.mode === 'light'
|
|
|
|
? theme.palette.primary.main
|
|
|
|
: theme.palette.primary.light,
|
2024-10-15 09:14:04 +02:00
|
|
|
color: theme.palette.primary.contrastText,
|
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
padding: theme.spacing(0.5),
|
|
|
|
}));
|
|
|
|
|
|
|
|
const StyledTitleContainer = styled('div')(({ theme }) => ({
|
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
gap: theme.spacing(1),
|
|
|
|
marginLeft: theme.spacing(1),
|
|
|
|
}));
|
|
|
|
|
|
|
|
const StyledTitle = styled(Typography)({
|
|
|
|
fontWeight: 'bold',
|
|
|
|
});
|
|
|
|
|
|
|
|
const StyledActionsContainer = styled('div')({
|
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
});
|
|
|
|
|
|
|
|
const StyledIconButton = styled(IconButton)(({ theme }) => ({
|
|
|
|
color: theme.palette.primary.contrastText,
|
|
|
|
}));
|
|
|
|
|
|
|
|
interface IAIChatHeaderProps {
|
|
|
|
onNew: () => void;
|
|
|
|
onClose: () => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const AIChatHeader = ({ onNew, onClose }: IAIChatHeaderProps) => {
|
|
|
|
return (
|
|
|
|
<StyledHeader>
|
|
|
|
<StyledTitleContainer>
|
2024-10-23 16:59:02 +02:00
|
|
|
<AIIcon />
|
2024-10-15 09:14:04 +02:00
|
|
|
<StyledTitle>Unleash AI</StyledTitle>
|
|
|
|
</StyledTitleContainer>
|
|
|
|
<StyledActionsContainer>
|
|
|
|
<Tooltip title='New chat' arrow>
|
|
|
|
<StyledIconButton size='small' onClick={onNew}>
|
|
|
|
<EditNoteIcon />
|
|
|
|
</StyledIconButton>
|
|
|
|
</Tooltip>
|
|
|
|
<Tooltip title='Close chat' arrow>
|
|
|
|
<StyledIconButton size='small' onClick={onClose}>
|
|
|
|
<CloseIcon />
|
|
|
|
</StyledIconButton>
|
|
|
|
</Tooltip>
|
|
|
|
</StyledActionsContainer>
|
|
|
|
</StyledHeader>
|
|
|
|
);
|
|
|
|
};
|