import { createMemo, type Accessor, type JSX, type Setter } from 'solid-js' import { useState } from '../state' import { expand } from '../utils' export function capitalizeFirstLetter(str: string): string { return str.charAt(0).toUpperCase() + str.slice(1) } export default function GalleryNav(props: { children?: JSX.Element closeText: string isAnimating: Accessor setIsOpen: Setter }): JSX.Element { // states const [state] = useState() const indexValue = createMemo(() => expand(state().index + 1)) const indexLength = createMemo(() => expand(state().length)) const onClick: () => void = () => { if (props.isAnimating()) return props.setIsOpen(false) } return ( <> ) }