Skip to content

Commit

Permalink
add a commit to Add comment requesting help to implement "Download as…
Browse files Browse the repository at this point in the history
… .csv" button (#459)

* add a commit to @coderabbitai

* add csv button

* perfect @coderabbitai that worked
  • Loading branch information
cohenaj194 authored Jul 1, 2024
1 parent 98b511f commit 682ba03
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions app/routes/wow.legacy-marketshare.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import type { ColumnList } from '~/components/types'
import { getOribosLink } from '~/components/utilities/getOribosLink'
import { getSaddlebagWoWLink } from '~/components/utilities/getSaddlebagWoWLink'
import DebouncedInput from '~/components/Common/DebouncedInput'
import CSVButton from '~/components/utilities/CSVButton'

const inputMap: Record<string, string> = {
homeRealmId: 'Home Realm',
Expand Down Expand Up @@ -317,6 +318,13 @@ const Results = ({
const chartData = getChartData(data, sortBy)

const columnList = getColumnList(region, server)

// Define the columns for the CSV
const csvColumns = columnList.map(({ columnId, header }) => ({
title: header,
value: columnId
}))

return (
<PageWrapper>
<Title title={pageTitle} />
Expand Down Expand Up @@ -349,12 +357,17 @@ const Results = ({
</>
</ContentContainer>

<div className="hidden sm:flex w-full justify-end">
<div className="flex justify-between">
<CSVButton
filename="legacy_marketshare.csv"
data={data}
columns={csvColumns}
/>
<DebouncedInput
onDebouncedChange={(value) => {
setGlobalFilter(value)
}}
className={'p-2 rounded-md'}
className={'hidden sm:block p-2 rounded-md'}
placeholder={'Search...'}
/>
</div>
Expand Down

0 comments on commit 682ba03

Please sign in to comment.