mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-19 07:56:02 +01:00
feat(interface/menu): checkbox
feat(package/interface/menu): checkbox feat(web/menu/list): checkbox feat(web/menu/list): checkbox option for ListItem feat(web/menu/list): custom checkbox
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
import { Box, Flex, Stack, Spacer, Text, IconProps } from '@chakra-ui/react';
|
||||
import { Box, Flex, Stack, Text } from '@chakra-ui/react';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { forwardRef } from 'react';
|
||||
import CustomCheckbox from './CustomCheckbox';
|
||||
import type { MenuItem } from './index';
|
||||
|
||||
interface Props {
|
||||
item: MenuItem;
|
||||
index: number;
|
||||
scrollIndex: number;
|
||||
checked: boolean;
|
||||
}
|
||||
|
||||
const ListItem = forwardRef<Array<HTMLDivElement | null>, Props>(({ item, index, scrollIndex }, ref) => {
|
||||
const ListItem = forwardRef<Array<HTMLDivElement | null>, Props>(({ item, index, scrollIndex, checked }, ref) => {
|
||||
return (
|
||||
<Box
|
||||
bg="#25262B"
|
||||
@@ -53,6 +55,11 @@ const ListItem = forwardRef<Array<HTMLDivElement | null>, Props>(({ item, index,
|
||||
<FontAwesomeIcon icon="chevron-right" fontSize={16} color="#909296" />
|
||||
</Stack>
|
||||
</Flex>
|
||||
) : item.checked !== undefined ? (
|
||||
<Flex alignItems="center" justifyContent="space-between" w="100%">
|
||||
<Text>{item.label}</Text>
|
||||
<CustomCheckbox checked={checked}></CustomCheckbox>
|
||||
</Flex>
|
||||
) : (
|
||||
<Text>{item.label}</Text>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user