mirror of
https://github.com/lc-soft/LCUI.git
synced 2026-11-30 16:48:21 +01:00
75 lines
2.2 KiB
TypeScript
75 lines
2.2 KiB
TypeScript
import {
|
|
Select,
|
|
SelectContent,
|
|
SelectGroup,
|
|
SelectItem,
|
|
SelectLabel,
|
|
SelectSeparator,
|
|
SelectTrigger,
|
|
SelectValue,
|
|
} from "@lcui/react";
|
|
|
|
const northAmerica = [
|
|
{ label: "Eastern Standard Time", value: "est" },
|
|
{ label: "Central Standard Time", value: "cst" },
|
|
{ label: "Mountain Standard Time", value: "mst" },
|
|
{ label: "Pacific Standard Time", value: "pst" },
|
|
{ label: "Alaska Standard Time", value: "akst" },
|
|
{ label: "Hawaii Standard Time", value: "hst" },
|
|
];
|
|
|
|
const europeAfrica = [
|
|
{ label: "Greenwich Mean Time", value: "gmt" },
|
|
{ label: "Central European Time", value: "cet" },
|
|
{ label: "Eastern European Time", value: "eet" },
|
|
{ label: "Western European Summer Time", value: "west" },
|
|
{ label: "Central Africa Time", value: "cat" },
|
|
{ label: "East Africa Time", value: "eat" },
|
|
];
|
|
|
|
const asia = [
|
|
{ label: "Moscow Time", value: "msk" },
|
|
{ label: "India Standard Time", value: "ist" },
|
|
{ label: "China Standard Time", value: "cst_china" },
|
|
{ label: "Japan Standard Time", value: "jst" },
|
|
{ label: "Korea Standard Time", value: "kst" },
|
|
{ label: "Indonesia Central Standard Time", value: "ist_indonesia" },
|
|
];
|
|
|
|
export default function Example() {
|
|
return (
|
|
<Select>
|
|
<SelectTrigger className="w-full max-w-64">
|
|
<SelectValue placeholder="Select a timezone" />
|
|
</SelectTrigger>
|
|
<SelectContent>
|
|
<SelectGroup>
|
|
<SelectLabel>North America</SelectLabel>
|
|
{northAmerica.map((item) => (
|
|
<SelectItem key={item.value} value={item.value}>
|
|
{item.label}
|
|
</SelectItem>
|
|
))}
|
|
</SelectGroup>
|
|
<SelectGroup>
|
|
<SelectLabel>Europe & Africa</SelectLabel>
|
|
{europeAfrica.map((item) => (
|
|
<SelectItem key={item.value} value={item.value}>
|
|
{item.label}
|
|
</SelectItem>
|
|
))}
|
|
</SelectGroup>
|
|
<SelectSeparator />
|
|
<SelectGroup>
|
|
<SelectLabel>Asia</SelectLabel>
|
|
{asia.map((item) => (
|
|
<SelectItem key={item.value} value={item.value}>
|
|
{item.label}
|
|
</SelectItem>
|
|
))}
|
|
</SelectGroup>
|
|
</SelectContent>
|
|
</Select>
|
|
);
|
|
}
|