import { Text } from "@mantine/core";
import type { TFunction } from "i18next";
import type { AdvancedColumn } from "@ema-platform/ui";
import type { Profession } from "../../types/configuration";

export function professionColumns(
  t: TFunction,
  locale: "en" | "am",
  getDeptName: (deptId: string) => string,
): AdvancedColumn<Profession>[] {
  return [
    {
      header: t("configuration.name"),
      cell: ({ row }) => row.original.name[locale],
      enabled: true,
    },
    {
      header: t("configuration.description"),
      cell: ({ row }) => (
        <Text size="sm" lineClamp={2} maw={200}>
          {row.original.description[locale]}
        </Text>
      ),
    },
    {
      header: t("configuration.department"),
      cell: ({ row }) => getDeptName(row.original.departmentId),
    },
  ];
}
