Packages

Potionx project generator. Provides a `mix potionx.new` task to bootstrap a new Elixir application with Phoenix, Absinthe, Pow and Vue dependencies.

Current section

Files

Jump to
potionx_new templates potionx frontend admin src useAdminHeaderAccount.ts
Raw

templates/potionx/frontend/admin/src/useAdminHeaderAccount.ts

import { AdminHeaderAccountProps } from "@potionapps/ui";
import { User } from 'shared/types'
import { routeNames } from './routes/routeNames'
import signOut from 'shared/signOut'
export default (user?: User) : AdminHeaderAccountProps => {
return {
btns: [
{
label: "Account",
to: {
name: routeNames.login
}
},
{
click: () => signOut(),
label: "Log Out"
}
],
initials: (user?.name?.[0] || "") + (user?.surname?.[0] || "")
}
}