feat(Like / dislike API ): more efficient api + checks and returns if match

This commit is contained in:
Laurian-Dufrechou
2023-05-03 00:35:40 +02:00
parent edcf469c29
commit a2ffdf1edb
5 changed files with 195 additions and 82 deletions
@@ -0,0 +1,36 @@
import {
Editable,
EditablePreview,
FormControl,
FormHelperText,
FormLabel,
UseEditableProps,
} from "@chakra-ui/react";
type CustomEditableProps = {
id: string;
label: string;
helperText?: string;
} & UseEditableProps;
export default function CustomEditable(props: CustomEditableProps) {
const { label, id, helperText = "", ...UseEditableProps } = props;
return (
<FormControl>
<FormLabel as="legend" htmlFor={id}>
{label}
</FormLabel>
<Editable
{...UseEditableProps}
fontWeight="bold"
isDisabled={true}
placeholder={"Non renseigné"}
color={"gray.500"}
>
<EditablePreview />
</Editable>
<FormHelperText>{helperText}</FormHelperText>
</FormControl>
);
}