profile: add button "message to telegram"

This commit is contained in:
vchikalkin 2025-01-15 18:15:04 +03:00
parent 2b1a499167
commit 53c74d565f

View File

@ -4,8 +4,10 @@ import { getProfile, updateProfile } from '@/actions/profile';
import { CheckboxWithText } from '@/components/profile/checkbox-with-text';
import { ProfileField } from '@/components/profile/profile-field';
import { Avatar, AvatarFallback, AvatarImage } from '@repo/ui/components/ui/avatar';
import { Button } from '@repo/ui/components/ui/button';
import { Card, CardContent, CardHeader } from '@repo/ui/components/ui/card';
import { useQuery } from '@tanstack/react-query';
import Link from 'next/link';
type ProfileCardProps = {
readonly telegramId?: string;
@ -57,6 +59,19 @@ export function ProfileCard({ telegramId }: ProfileCardProps) {
text="Быть мастером"
/>
)}
{telegramId ? (
<Button asChild className="w-full bg-foreground">
<Link
href={`https://t.me/${customer?.phone}`}
rel="noopener noreferrer"
target="_blank"
>
Написать в Telegram
</Link>
</Button>
) : (
false
)}
</CardContent>
</Card>
);