Home / Function/ AwsRegionSelector() — supabase Function Reference

AwsRegionSelector() — supabase Function Reference

Architecture documentation for the AwsRegionSelector() function in AwsRegionSelector.tsx from the supabase codebase.

Entity Profile

Relationship Graph

Source Code

apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/AwsRegionSelector.tsx lines 51–106

export const AwsRegionSelector = ({
  value,
  onChange,
}: {
  value: string
  onChange: (value: string) => void
}) => {
  const [open, setOpen] = useState(false)

  return (
    <Popover_Shadcn_ open={open} onOpenChange={setOpen}>
      <PopoverTrigger_Shadcn_ asChild>
        <FormControl_Shadcn_>
          <Button
            type="default"
            role="combobox"
            className={cn('w-full justify-between', !value && 'text-muted-foreground')}
            size="small"
            iconRight={
              <ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" strokeWidth={1} />
            }
          >
            {value ?? 'Select a region'}
          </Button>
        </FormControl_Shadcn_>
      </PopoverTrigger_Shadcn_>
      <PopoverContent_Shadcn_ className="p-0" sameWidthAsTrigger>
        <Command_Shadcn_>
          <CommandInput_Shadcn_ placeholder="Search AWS regions..." />
          <CommandList_Shadcn_>
            <CommandEmpty_Shadcn_>No regions found.</CommandEmpty_Shadcn_>
            <CommandGroup_Shadcn_>
              <ScrollArea className="h-72">
                {AWS_IDP_REGIONS.map((option) => (
                  <CommandItem_Shadcn_
                    value={option}
                    key={option}
                    onSelect={(currentValue) => {
                      onChange(currentValue === value ? '' : currentValue)
                      setOpen(false)
                    }}
                  >
                    <Check
                      className={cn('mr-2 h-4 w-4', option === value ? 'opacity-100' : 'opacity-0')}
                    />
                    {option}
                  </CommandItem_Shadcn_>
                ))}
              </ScrollArea>
            </CommandGroup_Shadcn_>
          </CommandList_Shadcn_>
        </Command_Shadcn_>
      </PopoverContent_Shadcn_>
    </Popover_Shadcn_>
  )
}

Subdomains

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free