diff --git a/app/desktop/components/flyouts/SwitchAccountAction.tsx b/app/desktop/components/flyouts/SwitchAccountAction.tsx new file mode 100644 index 00000000..fc2d1d40 --- /dev/null +++ b/app/desktop/components/flyouts/SwitchAccountAction.tsx @@ -0,0 +1,56 @@ +import type { JSX } from 'solid-js'; + +import { flip, shift } from '@floating-ui/dom'; + +import type { DID } from '~/api/atp-schema.ts'; +import { multiagent } from '~/api/globals/agent.ts'; + +import { MenuItem, MenuRoot } from '~/com/primitives/menu.ts'; + +import { Flyout } from '~/com/components/Flyout.tsx'; + +import DefaultUserAvatar from '~/com/assets/default-user-avatar.svg?url'; +import CheckIcon from '~/com/icons/baseline-check.tsx'; + +export interface SwitchAccountActionProps { + value?: DID | undefined; + onChange: (next: DID) => void; + children: JSX.Element; +} + +const SwitchAccountAction = (props: SwitchAccountActionProps) => { + return ( + + {({ close, menuProps }) => ( +
+ {multiagent.accounts.map((account) => ( + + ))} +
+ )} +
+ ); +}; + +export default SwitchAccountAction; diff --git a/app/desktop/components/panes/settings/GenericPaneSettings.tsx b/app/desktop/components/panes/settings/GenericPaneSettings.tsx index 5667a117..01a432d9 100644 --- a/app/desktop/components/panes/settings/GenericPaneSettings.tsx +++ b/app/desktop/components/panes/settings/GenericPaneSettings.tsx @@ -18,6 +18,7 @@ import DeleteIcon from '~/com/icons/baseline-delete.tsx'; import SyncAltIcon from '~/com/icons/baseline-sync-alt.tsx'; import { usePaneContext } from '../PaneContext.tsx'; +import SwitchAccountAction from '../../flyouts/SwitchAccountAction.tsx'; const GenericPaneSettings = () => { const { pane, deletePane } = usePaneContext(); @@ -103,17 +104,19 @@ const GenericPaneSettings = () => { 1}> - + (pane.uid = next)}> + +