Update Nextjs

This commit is contained in:
adilallo
2026-01-26 08:09:31 -07:00
parent 5442114c85
commit 9e8b767128
53 changed files with 825 additions and 283 deletions
+9 -6
View File
@@ -1,6 +1,9 @@
"use client";
import React, {
Children,
type ReactElement,
type ReactNode,
forwardRef,
useId,
useState,
@@ -265,17 +268,17 @@ const Select = forwardRef<HTMLButtonElement, SelectProps>(
}
// Handle children (option elements)
const selectedOption = React.Children.toArray(children).find(
const selectedOption = Children.toArray(children).find(
(
child,
): child is React.ReactElement<{
): child is ReactElement<{
value: string;
children: React.ReactNode;
children: ReactNode;
}> => {
if (!React.isValidElement(child)) return false;
const props = child.props as {
value?: string;
children?: React.ReactNode;
children?: ReactNode;
};
return props.value === selectedValue;
},
@@ -351,14 +354,14 @@ const Select = forwardRef<HTMLButtonElement, SelectProps>(
{option.label}
</SelectOption>
))
: React.Children.map(children, (child) => {
: Children.map(children, (child) => {
if (
React.isValidElement(child) &&
child.type === "option"
) {
const optionProps = child.props as {
value: string;
children: React.ReactNode;
children: ReactNode;
};
return (
<SelectOption