mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-24 07:26:31 +08:00
* Fix: Update stats calculation logic [APP-1607] * Fix: Set fixed width for the results table [APP-1650] * Fix: Update filter rules [APP-1634] * New: Add the no search results state [APP-1651] * Fix: Convert indents [n/a]
69 lines
1.8 KiB
JavaScript
69 lines
1.8 KiB
JavaScript
import Box from '@elementor/ui/Box';
|
|
import Typography from '@elementor/ui/Typography';
|
|
import { styled } from '@elementor/ui/styles';
|
|
import { AccessibilityAssistantNoResultsIcon } from '@ea11y/icons';
|
|
import { __ } from '@wordpress/i18n';
|
|
import { useAccessibilityAssistantContext } from '../../contexts/accessibility-assistant-context';
|
|
|
|
const AccessibilityAssistantNoResultsState = () => {
|
|
const { search } = useAccessibilityAssistantContext();
|
|
|
|
if (search) {
|
|
return (
|
|
<StyledWrapper>
|
|
<AccessibilityAssistantNoResultsIcon />
|
|
|
|
<StyledTitle variant="subtitle1" as="h3">
|
|
{__('No matching results found', 'pojo-accessibility')}
|
|
</StyledTitle>
|
|
|
|
<StyledSubtitle variant="body2">
|
|
{__(
|
|
'Try entering something else or checking if the spelling is correct before trying again.',
|
|
'pojo-accessibility',
|
|
)}
|
|
</StyledSubtitle>
|
|
</StyledWrapper>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<StyledWrapper>
|
|
<AccessibilityAssistantNoResultsIcon />
|
|
|
|
<StyledTitle variant="subtitle1" as="h3">
|
|
{__('No data to display for this period', 'pojo-accessibility')}
|
|
</StyledTitle>
|
|
|
|
<StyledSubtitle variant="body2">
|
|
{__(
|
|
'Try selecting a different timeframe to see your scan results.',
|
|
'pojo-accessibility',
|
|
)}
|
|
</StyledSubtitle>
|
|
</StyledWrapper>
|
|
);
|
|
};
|
|
|
|
const StyledWrapper = styled(Box)`
|
|
margin-top: ${({ theme }) => theme.spacing(6)};
|
|
|
|
text-align: center;
|
|
`;
|
|
|
|
const StyledTitle = styled(Typography)`
|
|
margin-top: 0;
|
|
margin-bottom: ${({ theme }) => theme.spacing(1)};
|
|
|
|
font-size: 16px;
|
|
font-weight: 500;
|
|
line-height: 130%;
|
|
letter-spacing: 0.15px;
|
|
color: ${({ theme }) => theme.palette.text.secondary};
|
|
`;
|
|
|
|
const StyledSubtitle = styled(Typography)`
|
|
color: ${({ theme }) => theme.palette.text.secondary};
|
|
`;
|
|
|
|
export default AccessibilityAssistantNoResultsState;
|