feat(StyledSelect): reexport the <select> component with styled

This commit is contained in:
WanQuanXie 2024-05-08 12:06:53 +08:00
parent aacde5a7a5
commit 0828045400
2 changed files with 53 additions and 28 deletions

View file

@ -0,0 +1,28 @@
import { cn } from '@/lib/utils';
import type { OptionHTMLAttributes, SelectHTMLAttributes } from 'react';
export interface StyledSelectProps
extends SelectHTMLAttributes<HTMLSelectElement> {}
export const StyledSelect = function StyledSelect({
className,
...restProps
}: StyledSelectProps) {
return (
<select
className={cn(
'bg-[#111111] px-3 py-2 flex items-center overflow-hidden border border-[#1C1C1C] text-white rounded-lg text-sm',
className,
)}
{...restProps}
/>
);
};
interface StyledSelectOptionProps extends OptionHTMLAttributes<HTMLOptionElement> {}
StyledSelect.Option = function StyledSelectOption(
props: StyledSelectOptionProps,
) {
return <option {...props} />;
};