Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
import languages from "@rallly/languages";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@rallly/ui/select";
import { LanguagesIcon } from "lucide-react";
export const LanguageSelect: React.FunctionComponent<{
id?: string;
className?: string;
value?: string;
onChange?: (language: string) => void;
"aria-label"?: string;
"aria-labelledby"?: string;
"aria-describedby"?: string;
}> = ({ id, className, value, onChange, ...ariaProps }) => {
return (
<Select
items={languages}
value={value}
onValueChange={(language) => {
if (language) {
onChange?.(language);
}
}}
>
<SelectTrigger id={id} className={className} {...ariaProps}>
<LanguagesIcon className="size-4 shrink-0 text-muted-foreground" />
<SelectValue />
</SelectTrigger>
<SelectContent>
{Object.entries(languages).map(([code, name]) => (
<SelectItem key={code} value={code}>
{name}
</SelectItem>
))}
</SelectContent>
</Select>
);
};