use create react app to simplify the application
This commit is contained in:
@@ -1,15 +1,22 @@
|
||||
import React from 'react';
|
||||
import './flag.scss';
|
||||
import {FlagType} from "../../model";
|
||||
import React from "react";
|
||||
import "./flag.scss";
|
||||
|
||||
export type FlagType = "new" | "changed" | "default";
|
||||
|
||||
interface ItemFlag {
|
||||
flag: FlagType;
|
||||
}
|
||||
|
||||
export default function Flag({ item, short = false }: { item: ItemFlag; short?: boolean }) {
|
||||
export default function Flag({
|
||||
item,
|
||||
short = false,
|
||||
}: {
|
||||
item: ItemFlag;
|
||||
short?: boolean;
|
||||
}) {
|
||||
const ucFirst = (s: string) => s.charAt(0).toUpperCase() + s.slice(1);
|
||||
|
||||
if (item.flag !== 'default') {
|
||||
if (item.flag !== "default") {
|
||||
let name = item.flag.toUpperCase();
|
||||
let title = ucFirst(item.flag);
|
||||
if (short === true) {
|
||||
|
||||
Reference in New Issue
Block a user