The prerendered hero is plain HTML between the markers (first photo, h1, buttons), the slider takes over after hydration with the hero of the host block, the API or the build. The head preload is added to the finished HTML. Hero texts move into nl.json. The stand-in host and the e2e tests cover the hero. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { chakra, useRecipe } from '@chakra-ui/react';
|
|
import { t } from '@/i18n';
|
|
import { Icon } from '@iconify/react/offline';
|
|
import caretRightOutlined from '@iconify-icons/ant-design/caret-right-outlined';
|
|
import pauseOutlined from '@iconify-icons/ant-design/pause-outlined';
|
|
|
|
type HeroPauseButtonProps = {
|
|
stopped: boolean;
|
|
onToggle: () => void;
|
|
};
|
|
|
|
// Rechtsonder, spiegelbeeld van de socials linksonder. De naam wisselt mee
|
|
// met de stand (W3C carrouselpatroon), daarom geen aria-pressed.
|
|
export default function HeroPauseButton({
|
|
stopped,
|
|
onToggle,
|
|
}: HeroPauseButtonProps) {
|
|
const iconControl = useRecipe({ key: 'iconControl' });
|
|
|
|
return (
|
|
<chakra.button
|
|
type="button"
|
|
aria-label={stopped ? t('hero.play') : t('hero.pause')}
|
|
data-testid="hero-pause-button"
|
|
data-requires-js
|
|
onClick={onToggle}
|
|
css={iconControl()}
|
|
position="absolute"
|
|
right="gutter"
|
|
bottom={{ base: 6, md: 10 }}
|
|
zIndex={2}
|
|
fontSize="1.5rem"
|
|
>
|
|
<Icon
|
|
icon={stopped ? caretRightOutlined : pauseOutlined}
|
|
aria-hidden
|
|
/>
|
|
</chakra.button>
|
|
);
|
|
}
|