{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "a",
  "txtContent": "@currentField",
  "style": {
    "text-decoration": "none",
    "color": "inherit",
    "padding-left": "8px"
  },
  "attributes": {
    "class": "ms-fontSize-m",
    "target": "=if([$FSObjType]=='1', '_self', '_blank')",
    "href": "=if([$FSObjType]=='1', [$FileRef], if(indexOf('docx,docm,doc,xlsx,xlsm,xls,pptx,pptm,ppt', [$File_x0020_Type]) != -1, @currentWeb + '/_layouts/15/Doc.aspx?sourcedoc=' + [$UniqueId] + '&action=' + if(indexOf('pptx,pptm,ppt', [$File_x0020_Type]) != -1, 'embedview', 'view'), [$FileRef]))"
  }
}
