Skip to content

Commit

Permalink
chore: add external link option to datatable
Browse files Browse the repository at this point in the history
  • Loading branch information
devjoaov committed Apr 29, 2024
1 parent b8beaf2 commit 62a0dcc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/DataTable/SWRDataTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ export const renderDataTableCell = ({ filters, column, row, selectedRows }) => {
);
case "select":
return value;
case "external_link":
return (
<a
href={value}
target="_blank"
rel="noreferrer"
className="underline text-primary flex items-center"
>
<Trans>Open</Trans>&nbsp;
<span>{column.columnDef.title}</span>
</a>
);
default:
return null;
}
Expand Down
1 change: 1 addition & 0 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"This action cannot be undone": "This action cannot be undone.",
"Cancel": "Cancel",
"Confirm": "Confirm",
"Open": "Open",
"Something went wrong!": "Something went wrong!",
"Pick a date": "Pick a date",
"Click to Upload": "Click to Upload",
Expand Down
1 change: 1 addition & 0 deletions src/locales/pt-BR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"This action cannot be undone.": "Esta ação não pode ser desfeita.",
"Cancel": "Cancelar",
"Confirm": "Confirmar",
"Open": "Abrir",
"Something went wrong!": "Algo deu errado!",
"Pick a date": "Escolha uma data",
"Click to Upload": "Clique para fazer upload",
Expand Down

0 comments on commit 62a0dcc

Please sign in to comment.