code format with pre-commit

This commit is contained in:
shamoon 2024-02-14 23:01:05 -08:00
parent 1a7c3d9da2
commit 59c9c68e78
2 changed files with 8 additions and 12 deletions

View File

@ -137,7 +137,7 @@ The list view utilizes extra space to display an additional field (which is opti
`field`: Defined the key with the desired value for the additional information. `field`: Defined the key with the desired value for the additional information.
`color`: Define a color scheme to the additional information for customization and/or distinction. `color`: Define a color scheme to the additional information for customization and/or distinction.
Allowed options: `["theme", "adaptive", "black", "white"]`. Other values will be ignored. Allowed options: `["theme", "adaptive", "black", "white"]`. Other values will be ignored.

View File

@ -117,14 +117,14 @@ function getColor(mapping, customData) {
} catch (e) { } catch (e) {
return ""; return "";
} }
case ("black"): case "black":
return `text-black`; return `text-black`;
case ("white"): case "white":
return `text-white`; return `text-white`;
case ("theme"): case "theme":
return `text-theme-500`; return `text-theme-500`;
default: default:
return "" return "";
} }
} }
@ -155,9 +155,7 @@ export default function Component({ service }) {
> >
<div className="font-thin pl-2">{mapping.label}</div> <div className="font-thin pl-2">{mapping.label}</div>
<div className="flex flex-row text-right"> <div className="flex flex-row text-right">
<div className="font-bold mr-2"> <div className="font-bold mr-2">-</div>
-
</div>
</div> </div>
</div> </div>
))} ))}
@ -188,11 +186,9 @@ export default function Component({ service }) {
> >
<div className="font-thin pl-2">{mapping.label}</div> <div className="font-thin pl-2">{mapping.label}</div>
<div className="flex flex-row text-right"> <div className="flex flex-row text-right">
<div className="font-bold mr-2"> <div className="font-bold mr-2">{formatValue(t, mapping, getValue(mapping.field, customData))}</div>
{formatValue(t, mapping, getValue(mapping.field, customData))}
</div>
{mapping.additionalField && ( {mapping.additionalField && (
<div className={`font-bold mr-2 ${getColor(mapping, customData)}`} > <div className={`font-bold mr-2 ${getColor(mapping, customData)}`}>
{formatValue(t, mapping.additionalField, getValue(mapping.additionalField.field, customData))} {formatValue(t, mapping.additionalField, getValue(mapping.additionalField.field, customData))}
</div> </div>
)} )}