"use client";

import { UsersIcon } from "lucide-react";
import { useTranslation } from "react-i18next";

interface SegmentTitleProps {
  readonly title?: string;
  readonly description?: string | null | undefined;
  readonly isPrivate?: boolean;
}

export const SegmentTitle = ({ title, description, isPrivate }: SegmentTitleProps) => {
  const { t } = useTranslation();

  if (isPrivate) {
    return (
      <div className="mb-4">
        <p className="text-sm font-semibold text-slate-800">
          {t("workspace.surveys.edit.send_survey_to_audience_who_match")}
        </p>
      </div>
    );
  }

  return (
    <div className="flex items-center gap-3">
      <div className="rounded-full border border-slate-200 bg-white p-2">
        <UsersIcon className="size-6 text-slate-600" />
      </div>
      <div className="flex flex-col">
        <h3 className="font-medium text-slate-900">{title}</h3>
        <p className="text-sm text-slate-500">{description}</p>
      </div>
    </div>
  );
};
