|
|
@@ -231,10 +231,21 @@
|
|
|
fetchPortfolio();
|
|
|
}
|
|
|
|
|
|
- function formatCode(input) {
|
|
|
- return input.includes(':')
|
|
|
- ? input.split(':')[1]
|
|
|
- : input;
|
|
|
+ function formatCode(code) {
|
|
|
+ return code.includes(':')
|
|
|
+ ? code.split(':')[1]
|
|
|
+ : code;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getFlag(code) {
|
|
|
+ const market = code.includes(':') ? code.split(':')[0].toUpperCase() : code.toUpperCase();
|
|
|
+
|
|
|
+ const country = {
|
|
|
+ FRA: 'de',
|
|
|
+ BVMF: 'br'
|
|
|
+ };
|
|
|
+
|
|
|
+ return country[market] || 'us';
|
|
|
}
|
|
|
|
|
|
function confirmDelete(code) {
|
|
|
@@ -364,7 +375,14 @@
|
|
|
{#each result as stock}
|
|
|
<tr>
|
|
|
<td class="code">
|
|
|
- <div class="col-code" title="{stock.code}">{formatCode(stock.code)}</div>
|
|
|
+ <div class="col-code" title="{stock.code}">
|
|
|
+ <img
|
|
|
+ src={`https://flagcdn.com/16x12/${getFlag(stock.code)}.png`}
|
|
|
+ alt="{getFlag(stock.code)} flag"
|
|
|
+ class="flag-icon"
|
|
|
+ />
|
|
|
+ {formatCode(stock.code)}
|
|
|
+ </div>
|
|
|
</td>
|
|
|
<td class="name">{stock.name}</td>
|
|
|
<td class="qty-edit">
|