added leave house, remove member
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { authClient } from '@lib/auth-client';
|
||||
import { m } from '@paraglide/messages';
|
||||
import { GearIcon, PenIcon } from '@phosphor-icons/react';
|
||||
import { Button } from '@ui/button';
|
||||
import { GearIcon } from '@phosphor-icons/react';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@ui/card';
|
||||
import { Skeleton } from '../ui/skeleton';
|
||||
import DeleteUserHouseAction from './delete-user-house-dialog';
|
||||
import EditHouseAction from './edit-house-dialog';
|
||||
import EditUserHouseAction from './edit-user-house-dialog';
|
||||
import LeaveHouseAction from './leave-house-dialog';
|
||||
|
||||
type CurrentUserActionGroupProps = {
|
||||
oneHouse: boolean;
|
||||
@@ -15,6 +16,10 @@ const CurrentUserActionGroup = ({
|
||||
oneHouse,
|
||||
activeHouse,
|
||||
}: CurrentUserActionGroupProps) => {
|
||||
if (!activeHouse) {
|
||||
return <Skeleton className="col-span-1" />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Card className="col-span-1">
|
||||
<CardHeader>
|
||||
@@ -24,17 +29,9 @@ const CurrentUserActionGroup = ({
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="flex flex-row gap-2">
|
||||
<EditHouseAction data={activeHouse as HouseWithMembers} isPersonal>
|
||||
<Button
|
||||
type="button"
|
||||
size="icon-lg"
|
||||
className="rounded-full cursor-pointer bg-blue-500 text-white hover:bg-blue-100 hover:text-blue-600"
|
||||
>
|
||||
<PenIcon size={16} />
|
||||
<span className="sr-only">{m.ui_edit_house_btn()}</span>
|
||||
</Button>
|
||||
</EditHouseAction>
|
||||
<EditUserHouseAction data={activeHouse} />
|
||||
{!oneHouse && <DeleteUserHouseAction activeHouse={activeHouse} />}
|
||||
<LeaveHouseAction activeHouseId={activeHouse.id} />
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user