<.dropdown id={"role-dropdown-#{@user.email}"}>
<:button class="role bg-transparent text-gray-900 dark:text-gray-100 hover:bg-gray-100 dark:hover:bg-gray-700 focus-visible:outline-gray-100 whitespace-nowrap truncate inline-flex items-center gap-x-2 font-medium rounded-md px-3.5 py-2.5 text-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:bg-gray-400 dark:disabled:text-white dark:disabled:text-gray-400 dark:disabled:bg-gray-700">
{@role |> to_string() |> String.capitalize()}
{@role |> to_string() |> String.capitalize()}
<:menu class="dropdown-items max-w-60">
<.role_item
user={@user}
id={"option-#{:erlang.phash2(@user.email)}-owner"}
phx-value-email={@user.email}
phx-value-name={@user.name}
role={:owner}
disabled={@disabled or @role == :owner}
dispatch_animation?={@role == :guest}
>
Manage the team without restrictions
<.role_item
user={@user}
id={"option-#{:erlang.phash2(@user.email)}-admin"}
phx-value-email={@user.email}
phx-value-name={@user.name}
role={:admin}
disabled={@disabled or @role == :admin}
dispatch_animation?={@role == :guest}
>
Manage all team settings
<.role_item
user={@user}
id={"option-#{:erlang.phash2(@user.email)}-editor"}
phx-value-email={@user.email}
phx-value-name={@user.name}
role={:editor}
disabled={@disabled or @role == :editor}
dispatch_animation?={@role == :guest}
data-confirm={if @me?, do: lower_role_warning()}
>
Create and view new sites
<.role_item
user={@user}
id={"option-#{:erlang.phash2(@user.email)}-billing"}
phx-value-email={@user.email}
phx-value-name={@user.name}
role={:billing}
disabled={@disabled or @role == :billing}
dispatch_animation?={@role == :guest}
data-confirm={if @me?, do: lower_role_warning()}
>
Manage subscription
<.role_item
user={@user}
id={"option-#{:erlang.phash2(@user.email)}-viewer"}
phx-value-email={@user.email}
phx-value-name={@user.name}
role={:viewer}
disabled={@disabled or @role == :viewer}
dispatch_animation?={@role == :guest}
data-confirm={if @me?, do: lower_role_warning()}
>
View all sites under your team
<.dropdown_divider />
<.dropdown_item
id={"#{:erlang.phash2(@user.email)}-remove"}
href="#"
disabled={@disabled or @remove_disabled}
phx-click="remove-member"
phx-value-email={@user.email}
phx-value-name={@user.name}
data-confirm="Are you sure you want to remove this member from the team?"
>
Remove member
Remove member from your team