import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { api } from "@/utils/api"; import { ExternalLink, GlobeIcon, RefreshCcw } from "lucide-react"; import Link from "next/link"; import React from "react"; import { AddDomain } from "./add-domain"; import { DeleteDomain } from "./delete-domain"; import { GenerateDomain } from "./generate-domain"; import { UpdateDomain } from "./update-domain"; interface Props { applicationId: string; } export const ShowDomains = ({ applicationId }: Props) => { const { data } = api.domain.byApplicationId.useQuery( { applicationId, }, { enabled: !!applicationId, }, ); return (
Domains Domains are used to access to the application
{data && data?.length > 0 && ( Add Domain )} {data && data?.length > 0 && ( )}
{data?.length === 0 ? (
To access to the application is required to set at least 1 domain
Add Domain
) : (
{data?.map((item) => { return (
); })}
)}
); };