feat: integrate Combobox component for timezone selection in CreateTaskDialog and AccountPage
This commit is contained in:
@@ -2,6 +2,7 @@ import { AppLayout } from '@/components/AppLayout'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
import { Combobox, type ComboboxOption } from '@/components/ui/combobox'
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -75,6 +76,13 @@ export function AccountPage() {
|
||||
const [providers, setProviders] = useState<UserProvider[]>([])
|
||||
const [providersLoading, setProvidersLoading] = useState(true)
|
||||
|
||||
// Prepare timezone options for combobox
|
||||
const timezoneOptions: ComboboxOption[] = getSupportedTimezones().map((tz) => ({
|
||||
value: tz,
|
||||
label: tz.replace('_', ' '),
|
||||
searchValue: tz.replace('_', ' ')
|
||||
}))
|
||||
|
||||
useEffect(() => {
|
||||
if (user) {
|
||||
setProfileName(user.name)
|
||||
@@ -390,21 +398,14 @@ export function AccountPage() {
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>Timezone</Label>
|
||||
<Select
|
||||
<Combobox
|
||||
value={timezone}
|
||||
onValueChange={setTimezone}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{getSupportedTimezones().map((tz) => (
|
||||
<SelectItem key={tz} value={tz}>
|
||||
{tz.replace('_', ' ')}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
options={timezoneOptions}
|
||||
placeholder="Select timezone..."
|
||||
searchPlaceholder="Search timezone..."
|
||||
emptyMessage="No timezone found."
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Choose your timezone for date and time display
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user